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

How do I get next date by day of week and time

I want to get next class date by day of week and time. For example all classes are held on Tuesday and Saturday at 10:45pm So I want to display date of next class to be held from current day/time. Without time I am able to get. But what if today is…
1
vote
2 answers

How to get the first business day in a new month after the weekend?

How can I in a smart way get the first business day of a month after the weekend? To get the first business day of the month (given dateInput), we can do: firstBusdayMonth = fbusdate(year(dateInput),month(dateInput)); As an example, for November,…
WJA
  • 6,676
  • 16
  • 85
  • 152
1
vote
1 answer

Print last week dates only corresponding to weekdays

I have below code: from datetime import date from datetime import timedelta today = datetime.date.today() for i in range(0,7): print (today - timedelta(days=i)) 2018-10-31 2018-10-30 2018-10-29 2018-10-28 2018-10-27 2018-10-26 2018-10-25 Want…
MGB.py
  • 461
  • 2
  • 9
  • 25
1
vote
2 answers

how to convert a simple python code weekday check

Okay, i wrote this code myself awhile ago but now im having trouble conerting it so it only does this years dates, ie the user would only have to type MM-DD instead of YYYY-MM-DD because we are going to assume its 2011
monica
  • 371
  • 1
  • 3
  • 4
1
vote
1 answer

Exclude Weekends in Calculation

I've been able to google some code that will remove weekends and holidays from calculations, I'm more concerned about removing the weekends. The code below works perfectly, I think you can use WorkdayDiff(), but since this is based off DateAdd(), I…
cm2115
  • 51
  • 1
  • 8
1
vote
1 answer

How to calculate the ISO week day using the ordinal day and the day of the week of the 1st of January?

I need to calculate the ISO week day for a specific date. I've currently got functions that calculate the ordinal day, as well as a function which calculates the day of the 1st of January in every year, however, I now need a function which will…
NoobAtC
  • 11
  • 1
1
vote
0 answers

Set notification in Android on specific days of week (days can be continuous or discontinuous)

I am building an app that takes input from user as days and then set notification for that days of week. Suppose for Wednesday and Friday every week at 2pm. I have used the code. Calendar setcalendar = Calendar.getInstance(); …
Taskeen
  • 57
  • 1
  • 5
1
vote
1 answer

Excel Date difference without weekend days

Last time I posted a quite vague story about a date difference challenge which I haven't solved yet. I will try to elaborate since I have tried everything in my power and the problem still isn't fixed. I currently have three columns. Column 1…
joopert
  • 21
  • 3
1
vote
3 answers

MySQL: find out whether weekday of date is between two weekdays with SQL

I have this vb.NET code and would like to write a function in MySQL that does the same thing. Public Function IsWeekdayTimeInRange(DateToCheck As DateTime, StartDayOfWeek As DayOfWeek, …
penCsharpener
  • 409
  • 7
  • 15
1
vote
3 answers

Excel Weekday function, finding day in week

I have a sheet with some dates, and to find Mondays, Tuesdays and Thursdays I use this code =HVIS.FEJL(SAMMENLIGN(DATO(ÅR(Året!$B$2);1;-2)-UGEDAG(DATO(ÅR(Året!$B$2);1;3))+AG5*7;Året!$B$6:$B$40;0);"") It will find the Mondays, and works fine - when…
Thomas BP
  • 1,187
  • 3
  • 26
  • 62
1
vote
1 answer

Selenium add weekdays to a date, weekend days not calculated correctly

I am running the below code on 6/7/2018 in order to omit weekends from any dates returned. However the code seems to determine the below days as the weekend. 13/7/2018 - Friday & 14/7/2018 - Saturday rather than 14/7/2018 - Saturday & 15/7/2018 -…
SteveL
  • 31
  • 3
1
vote
1 answer

Change local Ruby variable with Ajax in Ruby on Rails

I'm creating a scheduling page that shows a weekly schedule and want to make arrows at the bottom of the page that switch forward and backward a week. To do this I'm creating a variable in the controller, @wbeg, that defaults to the beginning of the…
dylanjack
  • 15
  • 2
1
vote
0 answers

Combine weekday and time in Python

The data I have is data that increases or decreases by 1 at certain periods in time. There is a weekly pattern in the cumulated sum, and I would like to plot the pattern of multiple weeks on top of each other to see if the pattern stays the same per…
Maaike317
  • 11
  • 1
1
vote
1 answer

Calculating workday difference between two calendar dates

I'm trying to find workday count between two dates (weekend and time have to ignore). I'm using following function to do that. But it is giving false results for multiple condition like if startdate is on weekend or enddate is on weekend. Here is…
nik
  • 1,464
  • 4
  • 18
  • 32
1
vote
2 answers

numpy apply along axis not working with weekday

I have a numpy array: >>> type(dat) Out[41]: numpy.ndarray >>> dat.shape Out[46]: (127L,) >>> dat[0:3] Out[42]: array([datetime.date(2010, 6, 11), datetime.date(2010, 6, 19), datetime.date(2010, 6, 30)], dtype=object) I want to get weekdays for…
dayum
  • 1,073
  • 15
  • 31