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
3
votes
1 answer

In Python how can I get a date based on a year, week number & weekday?

Given a date value and a number, I want to see how that number compares to the one for the equivalent day on preceding years. For 'equivalent day', I mean the same week number and the same weekday, NOT the same calendar date. For example, starting…
Jeremy Jones
  • 4,561
  • 3
  • 16
  • 26
3
votes
2 answers

SQL WHERE depending on day of week

I have a requirement to check records up to differing dates, depending on which day of the week it is currently. On a Friday I need for it to look at the entire next week, until Sunday after next. On any other day it should check the current week,…
coblenski
  • 1,119
  • 2
  • 11
  • 19
3
votes
2 answers

Simple SQL Query: need this month data and previous month last 5 days data together

Need SQL query for this month data and previous month last 5 days data together: SELECT CONVERT(VARCHAR (10), wDate, 103) AS wDate, Empid, Process, Model, Qty, Section, Avlbl_Mins, NP_Mins, L_Mins, NP_Reason AS NPReason, …
3
votes
2 answers

PHP bitwise to store days of the week

I'm trying to store chosen weekdays in one field in DB. Bitwise seem to be perfect for that, but PHP dosen't give the expected result, and i don't know why. mon tue wnd thu fri sat sun 1 1 1 1 1 1 1 1 2 4 8 16 32 64 so to…
sql_noobe
  • 55
  • 5
3
votes
4 answers

How to Find 5th or ending date of a particular day in a month based on date of the same month

I have been trying to find the 5th week date of a day in a month like 5th week Monday date, 5th week Tue date, Wed... and so on based on the date from the same month. This date could belong to any week of same month. I tried like DateTime…
Amar
  • 407
  • 1
  • 5
  • 24
3
votes
4 answers

Find next available day in an Array of string

I've been trying to figure out how to take next available day based on Present day i.e., if today is Friday, then search in Array for the next nearest day like if Array values are 1[Monday], 2[Tuesday], 4[Thursday], 6[Saturday] then my next day…
Amar
  • 407
  • 1
  • 5
  • 24
3
votes
1 answer

ToString("ddd") does not work for DayofWeek abbreviated to 3 characters

I am trying to simply get the 3 letter acronym for the day of the week. Monday = MON Tuesday = TUE and so on. I tried this but I get an error. string wsDoW = DateTime.Today.DayOfWeek.ToString("ddd"); The only way around it for me, is…
Fandango68
  • 4,461
  • 4
  • 39
  • 74
3
votes
2 answers

How to get every specific days of week within given date range in PHP?

This give me every monday date in date range. Question: How to get every monday and friday of week? $start_date = date('Y-m-d'); $end_date = date('Y-m-d', strtotime($start_date . ' + 1 MONTH')); for( $i = strtotime('Monday',…
Ing. Michal Hudak
  • 5,338
  • 11
  • 60
  • 91
3
votes
3 answers

another strange behaviour with GregorianCalendar

Take a look at the piece of code bellow: Calendar today1 = Calendar.getInstance(); today1.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY); System.out.println(today1.getTime()); Calendar today2 = new GregorianCalendar(2010, Calendar.JULY,…
L. Holanda
  • 4,432
  • 1
  • 36
  • 44
3
votes
2 answers

display day through stored procedure

I have an problem in MySQL stored procedure table tbl_teachers: id dat_teacher_doj fk_int_dept_id 1 1982-01-10 1 2 1979-09-01 1 3 1981-10-13 1 here i need to create an stored…
EjM
  • 103
  • 11
3
votes
1 answer

Get day (of week) of a special Date Java?

I have a Gregorian Date and I want to get it's day of week. I have try this but get wrong answer: Calendar calendar = new GregorianCalendar(); calendar.set(myYear, myMonth, myDay); int result = calendar.get(Calendar.DAY_OF_WEEK); switch (result)…
Mohammad H
  • 785
  • 2
  • 10
  • 25
3
votes
3 answers

how to implement Calendar view in two weeks mode(Used JTCalendar example)

I have implemented JTCalendar view to get both month and week view but in week view,i need to get two week view .Suggest me coding. JTCalendar code: CGFloat x = 0; CGFloat width = self.frame.size.width /…
Ganesh Kumar
  • 708
  • 6
  • 25
3
votes
1 answer

LocalDate from month and day of week in NodaTime

I'm looking to construct a date from a description such as "The second Monday in March, 2014". How would I go about doing so? LocalDate's FromWeekYearWeekAndDay seems like a start, but as I said, I'm hoping to provide the week of the month, not the…
Matt Kline
  • 10,149
  • 7
  • 50
  • 87
3
votes
2 answers

Match the 'day of week' integer between PHP and MySQL

I cannot decide on the best method to match the 'day of week' number between MySQL and PHP PHP $date = strtotime('2014-02-15'); $day_number = $day_of_week = date("w", $date); $day = $day_of_week = date('l', $date); echo $day."…
RonnyKnoxville
  • 6,166
  • 10
  • 46
  • 75
3
votes
2 answers

Find date for same day of the week last year?

OK so for example, today is Tuesday, Feb 02. Well the equivalent "Tuesday" from last year was on Feb 03. How can I find this out programmatically? Thanks!!
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422