A day of the week. Used for questions related to programming problems that involve `weekday`: calculation, triggering an event, discovery of a specific day etc
Questions tagged [weekday]
462 questions
6
votes
4 answers
How can I determine if week starts on Monday or Sunday based on locale in pure Javascript?
Well, the title is pretty explanatory - I need to figure out the day week start in local - it can be Monday, Sunday, Saturday or Friday - in pure Javascript.
I found this https://stackoverflow.com/a/727536/1226226

Oleh Melnyk
- 337
- 5
- 11
5
votes
5 answers
How to get the 7 days in a week with a currentDate in javascript?
(first, sorry for my bad english, i'm a beginner)
I have a chart of percent by date. I would like to display every day of the current week in the x-axis.
So, i tried to find how to get the seven days of the week.
that's what i have :
var curr = new…

Gaelle
- 614
- 1
- 7
- 30
5
votes
2 answers
How to get localized "One Letter" weekday abbreviations in Dart?
If I do this
DateTime dateTime = DateTime(2022, 5, 1); // Sunday
print(DateFormat("E").format(dateTime));
Sun will be printed out to the console. Which is what I expected.
This also works if I change the system language.
How to printout the…

Somjit Glin-Jan
- 81
- 7
5
votes
4 answers
Python: weekday position of following months
Given a date, how do you know the weekday position in the month (ex: third tuesday of the month) and how do you get the date for the same weekday for the next month (ex: third tuesday of the month+1)?

Tiago Moutinho
- 1,372
- 1
- 13
- 18
5
votes
2 answers
How can I get the previous weekday in PostgreSQL?
I'm new to SQL and was just wondering how to get the previous weekday in PostgreSQL. I have select (current_date - 1) to get yesterday's date but I need this to exclude weekends. So for example, if today is Monday then I would expect this query to…

SG216
- 51
- 1
5
votes
1 answer
In pandas, is there some compact way to plot data across days of the week?
I've got a simple dataframe with a set of values recorded against datetimes which are set to the index. Is there some compact way to get this data plotted across days of the week? I mean something like the following, with the days of the week across…

BlandCorporation
- 1,324
- 1
- 15
- 33
5
votes
5 answers
Get next day, skip weekends
I want to generate next working day using JavaScript.
This is my code as of now
var today = new Date();
today.setDate(today.getDate());
var tdd = today.getDate();
var tmm = today.getMonth()+1;
var tyyyy = today.getYear();
var…

werlox
- 53
- 1
- 1
- 5
5
votes
3 answers
Python datetime weekday number code - dynamically?
to get the weekday no,
import datetime
print datetime.datetime.today().weekday()
The output is an Integer which is within the range of 0 - 6 indicating Monday as 0 at doc-weekday
I would like to know how to get the values from Python
I wish to…

Isaac Philip
- 498
- 1
- 5
- 14
5
votes
2 answers
php first and last weekday (workable Mon-Fri) of month using simple strtotime
Solved! i leave it here for you.
This two lines of code are ok for the first workable day:
date('d-m-Y',strtotime('+0 weekdays October 2016'))
Returns : 3-10-2016 --> OK
date('d-m-Y', strtotime('weekday february 2016'))
Returns : 1-2-2016 …

Jonathan Orrego
- 131
- 2
- 6
5
votes
3 answers
Rails - Determine the day of the week
So DateTime.current returns Fri, 11 Mar 2016 19:34:10 +0000.
How can I determine the day of the week. For example, if DateTime.current is Friday(just the day of the week, regardless of the date)?
DateTime.current == DateTime.parse("Friday") Won't…

fardin
- 1,399
- 4
- 16
- 27
5
votes
2 answers
How to get Day Name from date in PHP?
How to get Day Name from date in PHP?
$dateValue='2015/07/15';
$dayName=date("D", strtotime($dateValue);
Hi,
I want exact day name from the above given sample date, please help me.

siva
- 593
- 3
- 8
- 19
5
votes
1 answer
Only Select Friday and coming Monday in mysql
I have assignment on my hand of building an Attendance system which I am doing all right but I am stuck at one place. When counting the leaves, if a person takes a leave on Friday and then take leave again on Monday, then the in between Saturday and…

awatan
- 1,182
- 15
- 33
4
votes
2 answers
Algorithm to find continuous days in a week
The user can select any number of week days from a list. An algorithm shall find the longest continuous group of selected days. The start day can be after the end day, if the group spans two weeks. If it makes it simpler, only a group of at least 3…

ygoe
- 18,655
- 23
- 113
- 210
4
votes
3 answers
32 hours ago excluding weekends with php
So I have a script that does multiple checks for 32, 48 and 72 hours ago.
Basically I check my database for entries that are at least x hours old.
Now this works fine like this:
$date = date('Y-m-d H:i:s',strtotime('-32 hours'));
$q = "SELECT *…

Kokos
- 9,051
- 5
- 27
- 44
4
votes
1 answer
How to get the first, second, third, and fourth week of the month?
I want to get all four weeks (first and last day date) on the current month with Monday as the start of the week.
I can only figure out how to get the current week's first and last date with this code:
var firstDayOfTheWeek = …

Gilbert Aligoey
- 127
- 8