Questions tagged [weekday]

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

462 questions
1
vote
1 answer

Dropping / Retaining rows based on weekdays and holidays. Python 3.8 / Spyder / W10

In a data frame, I wish to drop all the rows with dates which do not fall on Last Friday of the Month. But if data does not exist on a Friday (being a holiday) then retain row from a day before i.e. Thursday. If Friday and Thursday both are holidays…
Dan
  • 77
  • 7
1
vote
2 answers

Formula for if a cell is blank, It will consider the previous cell as the value for that cell and sum the cells together

I am trying to figure out how to sum a row of cells where if a cell in the row has a letter, for example a letter "X", to consider the cell to the left of it in the row as a value for that cell when summing up the row. For my table the reason behind…
1
vote
1 answer

Flutter: Get Wrong days of the week

from Monday - Thursday, I get the right days, but from Friday, I get the wrong days. Why? Code example: Text(DateFormat('EEEE').format(DateTime(DateTime.friday))), And i get Saturday. Is that a bug?
Tolga
  • 335
  • 2
  • 4
  • 17
1
vote
1 answer

Transform "Y-m-w" to date - first Monday of the week

I am trying to convert %Y-%m-%w to the first date of the respective week starting on Monday. So %Y-%m-%w to %Y-%m-%d x <- c("2020-09-01", "2020-09-03", "2020-09-04", "2020-09-05") 2020-09-01 -> 2020-08-31 2020-09-03 -> 2020-09-14 2020-09-04 ->…
1
vote
2 answers

How to change the ouput from 1 to Monday?

I am using code from here: https://www.geeksforgeeks.org/find-day-of-the-week-for-a-given-date/. It finds the day of the week a date falls on. The output is a number corresponding to the day of the week but I would like it to say 'Monday' instead of…
1
vote
2 answers

function gives wrong total of a week day between a date range in django

I have been looking at this function for hours and I can't seem to figure out why it is not giving me the result I am expecting. I have a test that generates a datetime start and datetime end. I want to calculate how many 'mondays' or any given day…
sam
  • 33
  • 4
1
vote
1 answer

Difference between two timestamps with different weekdays?

I've the following dates: Tue 19:00-20:00 Wed 04:25-15:14 How can i get the difference between Tue 20:00 and Wed 04:25? I've tried to transform it in datetime objects but since i don't have the day of the month or a year both objects will get the…
Rafa Acioly
  • 530
  • 9
  • 34
1
vote
2 answers

Python: Implement a column with the day of the week based on the "Year", "Month", "Day" columns?

I try to create a new column with the day of the week: df2019['Weekday']=pd.to_datetime(df2019['Year'],df2019['Month'],df2019['Day']).weekday() And I get the following error: ValueError: The truth value of a Series is ambiguous. Use a.empty,…
Miguel Gonzalez
  • 398
  • 1
  • 12
1
vote
1 answer

Google Charts - Show day of the week in local language

How do I make a Google Chart axis to use day of the week names in different languages (e.g. in German). For tooltip I use var formatter = new google.visualization.DateFormat({ pattern: 'EEEE, dd.MM.YYYY' }); Here it produces Tuesday, 31.03.2020,…
Matti
  • 13
  • 4
1
vote
0 answers

Symfony Weekday Select

this is my first question, so sorry if I miss some information. In my project I try to create a FormType with a ChoiceType. The ChoiceType should contain the weekdays (eg. monday, tuesday, etc). Now I was wondering how I should deal with this…
Haiberd
  • 124
  • 5
1
vote
3 answers

How to get last Sunday's date?

I need to show last Sunday's date in a cell for a weekly report that I'm creating on google sheets. I've been googling to find a solution and the closest I found is this: =TODAY()+(7-WEEKDAY(TODAY(),3)) But this gives next Monday's date. Any idea…
1
vote
1 answer

in mssql get first, second, third weekdate of current month, what date would it be the next month

Given a date lets say Aug 2, 2019 which is first friday of the month. what would be the first friday of next month (sept 6th). Now lets say I have sept 26th which is the last thur of the month. what date would it be for the last thur of next month.…
Uday Patel
  • 11
  • 1
1
vote
1 answer

Is there a replacement for this syntax?

with the new update on pandas I can't use this function that I used on on Datacamp learning course - (DAYOFWEEK doesn't exist anymore) days_of_week = pd.get_dummies(dataframe.index.dayofweek, prefix='weekday', …
Thiago AV
  • 55
  • 4
1
vote
1 answer

How can I know the number of remaining mondays, tuesdays, wednesdays, ..., and sundays in a month using SQL?

I want to update the values of a row that has a date column and I want to generate the column values of RemainingMondays, RemainingTuesdays, etc. in that month. For example if I have 2019-03-20 (March 20th, 2019) I need to update that row with the…
1
vote
2 answers

Mapping data to the same weekday in another year in Python pandas

I have a pandas dataframe of electricity consumption data throughout a year, but would like to update the table to be in another year. I would like the data values to fall on the same weekdays as before. What I have: Date 00:00 ... …
N.Homer
  • 25
  • 5