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
166
votes
15 answers

How to get the day of week and the month of the year?

I don't know much about Javascript, and the other questions I found are related to operations on dates, not only getting the information as I need it. Objective I wish to get the date as below-formatted: Printed on Thursday, 27 January 2011 at…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
133
votes
10 answers

How to get the integer value of day of week

How do I get the day of a week in integer format? I know ToString will return only a string. DateTime ClockInfoFromSystem = DateTime.Now; int day1; string day2; day1= ClockInfoFromSystem.DayOfWeek.ToString(); /// it is not working day2=…
akshaykumar6
  • 2,147
  • 4
  • 18
  • 31
115
votes
9 answers

How to group by week in MySQL?

Oracle's table server offers a built-in function, TRUNC(timestamp,'DY'). This function converts any timestamp to midnight on the previous Sunday. What's the best way to do this in MySQL? Oracle also offers TRUNC(timestamp,'MM') to convert a…
O. Jones
  • 103,626
  • 17
  • 118
  • 172
81
votes
3 answers

How to get the week day name from a date?

Given 03/09/1982 how can we say it is which week day. In this case it will be Tue. Is it possible to get in a single query?
user1025901
  • 1,849
  • 4
  • 21
  • 28
73
votes
5 answers

Get weekday/day-of-week for Datetime column of DataFrame

I have a DataFrame df like the following (excerpt, 'Timestamp' are the index): Timestamp Value 2012-06-01 00:00:00 100 2012-06-01 00:15:00 150 2012-06-01 00:30:00 120 2012-06-01 01:00:00 220 2012-06-01 01:15:00 …
EP1986
  • 853
  • 1
  • 7
  • 14
64
votes
4 answers

Correctness of Sakamoto's algorithm to find the day of week

I am using Sakamoto's algorithm to find out the day of week from a given date. Can anybody tell me the correctness of this algorithm? I just want this from 2000 to 2099. The algorithm from Wikipedia is given for reference. int dow(int y, int m, int…
Harikrishnan
  • 3,664
  • 7
  • 48
  • 77
42
votes
8 answers

How to get localized short day-in-week name (Mo/Tu/We/Th...)

Can I get localized short day-in-week name (Mo/Tu/We/Th/Fr/Sa/Su for English) in Java?
fhucho
  • 34,062
  • 40
  • 136
  • 186
40
votes
6 answers

Android Calendar get current day of week as string

i tried to get a string with the name of the actual weekday this way: Calendar c = Calendar.getInstance(); int dayOfWeek = c.get(Calendar.DAY_OF_WEEK); if (c.get(Calendar.MONDAY) == dayOfWeek) weekDay =…
ntm
  • 731
  • 2
  • 13
  • 37
38
votes
2 answers

C# Cultures: Localize DayOfWeek?

How do I localize a DayOfWeek other than today? The following works just fine for the current day: DateTime.Now.ToString("dddd", new CultureInfo("it-IT")); But how can I localize all days of the week?? Edit: A possible (and probably very, very…
bevacqua
  • 47,502
  • 56
  • 171
  • 285
33
votes
4 answers

Generate date from week number in moment.js

As mentioned in the title, I have a week number and a year value. Is there a way of finding Monday of that week using moment.js? Was trying, but not succeeded
Bartosz
  • 4,542
  • 11
  • 43
  • 69
32
votes
6 answers

Get the Day of a week from integer value of the Day

I have converted several days of the week to their respective integer values.. For example: Tuesday, Thursday, Friday As 2,4,5 Now I need to get back to the days from the integers. Simply the inverse of what i had done. Inverse of the Question: Get…
parkourkarthik
  • 834
  • 1
  • 8
  • 20
32
votes
7 answers

Get current week start and end date in Java - (MONDAY TO SUNDAY)

Today is 2014-04-06 (Sunday). The output I get from using the code below is: Start Date = 2014-04-07 End Date = 2014-04-13 This is the output I would like to get instead: Start Date = 2014-03-31 End Date = 2014-04-06 How can I achieve this? This…
Scorpion
  • 6,831
  • 16
  • 75
  • 123
31
votes
7 answers

In Java, how to get strings of days of week (Sun, Mon, ..., Sat) with system's default Locale (language)

The simplest way: String[] namesOfDays = new String[7] { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" }; This method does not use Locale. Therefore, if the system's language is not English, this method does not work properly. Using Joda…
Naetmul
  • 14,544
  • 8
  • 57
  • 81
30
votes
9 answers

Retrieve current week's Monday's date

We have a utility that will run any day between Monday - Friday. It will update some number of files inside a Content Management Tool. The last modified date associated with that file should be, that week's monday's date. I wrote the following…
Shashank Kadne
  • 7,993
  • 6
  • 41
  • 54
28
votes
3 answers

Get the weekday from a Date object or date string using JavaScript

I have a date string in (yyyy-mm-dd) format, how can I get the weekday name from it? Example: For the string "2013-07-31", the output would be "Wednesday" For today's date using new Date(), the output would be based on the current day of week
dpmzmdr
  • 347
  • 1
  • 3
  • 5
1
2 3
45 46