Questions tagged [dayofweek]

Usually a function that returns day of the week when a certain date object is passed.

Get day of day of the week in:

691 questions
2
votes
2 answers

Get previous weekday + MySQL

I need to get the previous weekday. So when it's monday I need to get the result friday but I can't seem to understand the WEEKDAY() function. Could someone help to start with this?
nielsv
  • 6,540
  • 35
  • 111
  • 215
2
votes
3 answers

Input date parameter and return day of week in batch file

I need to send a date to a batch file and have it return the day of the week. The date parameter could be in the past or in the future. I have looked through a number of date functions but they are all using today's date. Is it possible to return…
2
votes
2 answers

How many specific days within a date range in Javascript

I have two dates. One is starting date and another is ending date. I want to calculate how many Saturdays, Mondays and Wednesdays falls within the date range? How can I solve it? I saw several tutorial but they are only counting the dates within…
user3150647
  • 45
  • 2
  • 5
2
votes
5 answers

Check if Any Checkbox is Checked

I have checkboxes for week days in my android application , and I want to put a listener to check if any one of these checkboxes is checked but my way seems hard , isn't there a way to gather all these listeners into one …
user1928775
  • 355
  • 1
  • 5
  • 15
2
votes
3 answers

My C program that uses Zeller's algorithm is very buggy on leap years, not sure why?

The program is supposed to return what day of the week it is for the entered date. One of the dates that doesn't work is 01012000. Nothing is returned at all. But on some other leap years the first day of March can be calculated. Also sometimes…
2
votes
2 answers

Android get week day names between two dates

I want to get day names between two dates with simple Java, without using any third party library. I want to get names like Saturday, Sunday, Monday between two days inclusive both.
AZ_
  • 21,688
  • 25
  • 143
  • 191
2
votes
1 answer

PHP - get first day of a given week number when week starts on day other than Monday

In my PHP app I have three variables: Code: $year = 2014 $weeknumber = 1 $weekstarts = 6 //Week starts on Saturday. 1=Monday... 6=Saturday and 7=Sunday With these three parameters I would like to figure out what is the first day of the week. In…
dev4life
  • 10,785
  • 6
  • 60
  • 73
2
votes
2 answers

Calculate DateTime for upcoming day of week

This is the code I have at the moment: String getDayRequested; public void setDay(String getDayFromForm1) { getDayRequested = getDayFromForm1; { if (getDayRequested.Contains("today")) { getDayRequested =…
The Woo
  • 17,809
  • 26
  • 57
  • 71
2
votes
3 answers

Name of day in string format with days to furure

I need name of day in week but dependent o actual date and date to future. For example I need name of day today, then name of day tomorrow, name of date +2 days etc I make this code but not working good. So is there any better way how I can in…
pavol.franek
  • 1,396
  • 3
  • 19
  • 42
2
votes
6 answers

ASP.NET/C#: Get nearest future date based from list of days

I would like to get the nearest based from a list of days: Scenario 1: Date: July 22, 2013 (Monday) Possible days: "Tuesday", "Wednesday", "Friday" (string values) Answer: July 23, 2013 (Tuesday) Scenario 2: Date: July 23, 2013 (Tuesday) Possible…
abramlimpin
  • 5,027
  • 11
  • 58
  • 97
2
votes
3 answers

How can I get the date after one week in iOS programmatically?

I am very new to iOS development. I want to get the date after one week. I use the code to get the current date as below. NSDate *currentDateTime = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter…
user2049933
  • 51
  • 2
  • 4
2
votes
1 answer

Week Incrementation using Javascript

I'm working on a reminders application using Phonegap [Javascript + Html5] in which the user enters the weekly task he wants to be reminded of and I'm supposed to alert a notification every week on that day. Now the point is: I use Phonegap Local…
Sana Joseph
  • 1,948
  • 7
  • 37
  • 58
2
votes
1 answer

Initializing C# DayOfWeek Enum

According to the MSDN doc here, each member of the Enum can be cast to Int to get a corresponding 0-indexed value. But I want to convert an Int value, ranging from 0 to 6, to this Enum. How is this possible?
Babu James
  • 2,740
  • 4
  • 33
  • 50
2
votes
2 answers

Run parts of a batch file based on the day of the week

I am running a dos batch file in SQL Server Agent job. I have 34 steps in the batch file. All steps run every day EXCEPT step 31. It only runs on Tuesday. I could setup another SQL Agent Job, but that seems like overkill. How can I query the…
MikeTWebb
  • 9,149
  • 25
  • 93
  • 132
2
votes
1 answer

MySql SELECT WHERE Date is greater than past 10 weeks (starting at prev Sunday)

The problem I'm running into is when running this query it starts the week interval from the current date (minus 7 days from current date). I want to do all previous 10 weeks (Sun-Mon). So if my current date is on a Monday, Tuesday, or Wednesday,…
ToddN
  • 2,901
  • 14
  • 56
  • 96