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
4
votes
2 answers

iOS 6 NSDateFormatter stringFromDate: empty day of week

I'm having an issue with obtaining the full name for the day of week in iOS 6 NSDate object (in iOS 7 works fine). I've searched stackoverflow for similar issues but I didn't find what I was looking for. My test case is: formatter =…
ZeCodea
  • 1,071
  • 9
  • 26
4
votes
1 answer

Calculate number of specific days in range

How can I count the (fractional) count of specific day of the week in a range? For instance, if the range is from Monday, June 3 12:00 P.M. to Tuesday June 4 12:00 P.M., and I want to count the number of Mondays, the formula would return the result…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
4
votes
2 answers

find the Monday or Wednsday before a date in excel

I have a list of assignments in excel 2010. Each has a due date. The assignment must be submitted for external processing 3 working days before the due date. Before the assignment can be sent to external processing, it must be reviewed. …
jpolache
  • 305
  • 3
  • 12
4
votes
2 answers

Determining day of the week using Zeller's Congruence

I tried writing the code for finding the day of the week for a given date using Zeller's Congruence but I'm not getting the correct output. What's wrong with my code? #include #include int main() { int h,q,m,k,j,day,month,year; …
Shail
  • 881
  • 9
  • 20
  • 37
4
votes
2 answers

PostgreSQL Extract() DOW : why not Date datatype in addition to timestamp?

According to the PostgreSQL version 8.1 date-time function docs: dow The day of the week (0 - 6; Sunday is 0) (for timestamp values only) SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40'); Result: 5 Why is not a Date datatype also a valid…
Tim
  • 8,669
  • 31
  • 105
  • 183
4
votes
4 answers

How to get day from specified date in android

Suppose my date is 02-01-2013 and it is stored in a variable like: String strDate = "02-01-2013"; then how should I get the day of this date (i.e TUESDAY)?
4
votes
2 answers

mysql select records next to current time

this is a food service system... I have a table named, detalle_regimen_paciente, it stores a diet, with breakfast for monday - sunday (being 1 for monday and 7 for sunday, chilean type) that also have a specific serving…
4
votes
2 answers

Unsure what get(Calendar.DAY_OF_WEEK) returns

My problem can be easily created by the scenario below: //create a gregorian calendar object that set the date and time as 4th June 2012 at 10:30PM Calendar calendar = new GregorianCalendar(2012, 6, 4, 22, 30); //when I print out these: …
user1442080
  • 41
  • 1
  • 1
  • 2
3
votes
2 answers

PHP echo all days of week (strftime)

I was wondering if there is a way to use the locale in strftime to echo all days of the week, regardless of date. To use as sort of headings or titles and rather than using constants and loading the correct one. i.e. setlocale(LC_TIME,…
Stevanicus
  • 7,561
  • 9
  • 49
  • 70
3
votes
8 answers

Getting number of certain days-of-the-week (weekend) from interval in PostgreSQL

Given 2 timestamps in postgres, how do you calculate the time difference without counting whole Saturdays and Sundays? OR How do you count the number of Saturdays and Sundays in a given time interval?
Ole
  • 302
  • 1
  • 4
  • 8
3
votes
1 answer

Repeat blocks of columns and rows N times dynamically in Google Sheets

I am currently working on a scheduling spreadsheet in Google Sheets and am looking for a way to repeat a block of cells with dynamic values a fixed number of times. I tried using REPT and SPLIT, but these just repeat the text value of the cell and…
kamisama42
  • 595
  • 4
  • 18
3
votes
2 answers

Java Time parse Dates with short day names

I've got the following German date: So, 18 Jul 2021 15:24:00 +0200 I'm unable to parse it using Java Time: DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss Z", Locale.GERMANY) .parse("So, 18 Jul 2021 15:24:00 +0200", Instant::from) as it…
Niklas
  • 23,674
  • 33
  • 131
  • 170
3
votes
3 answers

Java Calendar DAY_OF_WEEK SET to zero

I have this very old code block from PROD (>7 years) to be debugged. There's one point I couldnt understand. A section in the code does a calculation of next time a task will run and for tasks who need to run specifically on sunday, monday it uses…
dora
  • 33
  • 5
3
votes
4 answers

Obscure C syntax for Tomohiko Sakamoto's algorithm

I stumbled upon this version of the Sakamoto algorithm dow(m,d,y){y-=m<3;return(y+y/4-y/100+y/400+"-bed=pen+mad."[m]+d)%7;} I tried it on ideone.com and it actually works. I'm not interested in how the algorithm works, it's the syntax that baffles…
mfloris
  • 361
  • 4
  • 16
3
votes
2 answers

How to use mod function for linq to ms access?

I am trying to query day of week using linq and I have ms access as the database. Now I have used the following code using % (mod) to check for day of week since linq to query doesn't support DayOfWeek. planQuery = planQuery.Where(x =>…
SZT
  • 1,771
  • 4
  • 26
  • 53