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

DateTimeFormatter week-based-year diff

I'm migrating my application from Joda-Time to the Java 8 java.time. One of the things I ran into is the printing of a week-based-year using a pattern in the DateTimeFormatter. NOTE: I have seen this question: Java Time's week-of-week-based-year…
Niels Basjes
  • 10,424
  • 9
  • 50
  • 66
2
votes
2 answers

Python Create dummy variables based on day of week in double index

I have a dataframe with a double index (day, time) and would like to create new columns 'Monday', 'Tuesday', 'Wednesday' etc equal to one if the index day is in the correct day. My original dataframe: Visitor Date Time…
Batmax
  • 253
  • 8
  • 17
2
votes
2 answers

Find Closest Week Day in DayOfWeek List

This is probably a newbie question, but here goes. I have a method where a type DayOfWeek List that gets appended with various days of the week (Could be Wednesday & Saturday, Sunday, Monday, & Friday, etc). Given that list, I need to compare it to…
wibby35
  • 97
  • 1
  • 1
  • 9
2
votes
2 answers

Check day of an ISO date

I have a date field in ISO format like this: 2017-06-06T00:00:00 I'm looking for a way to find if the date string above represents Saturday or Sunday. I've read some post and all of them have a Date object format date and not an ISO date. I really…
RamAlx
  • 6,976
  • 23
  • 58
  • 106
2
votes
5 answers

Convert a string of weekday abbreviations, including ranges, into a List

I have string "Mon-Thu, Sun". I need to convert it into new List{DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Sunday} I think about spliting this string into string array and then parse strings…
demo
  • 6,038
  • 19
  • 75
  • 149
2
votes
2 answers

Get day of week from current date and specifying first day of week

I am migrating a legacy VB6 project into C#. I want to obtain the equivalent in C# from expression below: Weekday(Date, vbMonday) I know there is a function in C#: int dayOfWeek = (int)DateTime.Today.DayOfWeek; but how to specify that the first…
Willy
  • 9,848
  • 22
  • 141
  • 284
2
votes
2 answers

FullCalendar.io get selected day of the week

Im using the following plugin: FullCalendar.js by : [https://fullcalendar.io/][1] I am using this with ajax and JSON with an API. however i would like to know if its possible to get the selected day of the week as I want to make certain conditions…
user1673498
  • 431
  • 1
  • 8
  • 26
2
votes
2 answers

How can I use DayOfWeek enum to flag process cycles?

In app.config, I supply a cycle string value: "Monday", "Tuesday", ..., "Daily". From that value I wanted to assign a enum. Simply using DayOfWeek does not give me the ability to flag a process as a daily routine. Is there an available…
IAbstract
  • 19,551
  • 15
  • 98
  • 146
2
votes
2 answers

Cassandra - How to get the Day of week from the timestamp column?

I have a timestamp column in a Cassandra table, how do i get the day of week from the timestamp column using cql?
Shankar
  • 8,529
  • 26
  • 90
  • 159
2
votes
1 answer

Pandas: dt.dayofweek showing incorrect values

I am struggling to understand why the day of week is interpreting a Friday as day of week 4. Some simple data: import pandas as pd # Simple time series data: series = pd.Series({"2017-02-20": 1, '2017-02-21':2, '2017-02-22':3, '2017-02-23': 4,…
EB88
  • 841
  • 1
  • 10
  • 26
2
votes
4 answers

How to Get the Same Weekday Last Year Given any Given Year?

I would like to get the same day last year given any year. How can I best do this in R. For example, given Sunday 2010/01/03, I would like to obtain the Sunday of the same week the year before. # "Sunday" weekdays(as.Date("2010/01/03",…
user2058291
  • 107
  • 3
  • 10
2
votes
1 answer

Querying a List of objects to find the the day of the week with the most items

There's got to be a better way! I have a bunch of log records stored in a List. Each log record has a CreateDate field and what I'm trying to do is find an efficient way to query the List object to find the day of the week with the most log records…
fynnbob
  • 553
  • 1
  • 5
  • 14
2
votes
2 answers

Android: how to get all the dates of the month after selecting the certain month and weekdays?

I've made a spinner for selecting a certain month, then I've also created some checkbox for choosing certain days, then how can i show all the dates after choosing such information? E.g. If i choose January and pick Mondays and Wednesdays, how can i…
chunyuen2
  • 53
  • 1
  • 6
2
votes
2 answers

Pandas Dataframe, assign values to day of the week. Feature extraction

I am extracting features to look for the weekdays. What I have so far is this: days = {0:'Mon', 1: 'Tues', 2:'Wed', 3:'Thurs', 4:'Fri', 5:'Sat', 6:'Sun'} data['day_of_week'] = data['day_of_week'].apply(lambda x: days[x]) data['if_Weekday'] =…
ALK
  • 87
  • 1
  • 2
  • 9
2
votes
1 answer

Get certain weekday within a week given by a DATETIME

I need to pass one DateTime and DayOfWeek and from that I need to get DateTime of that selected week. --Sunday-1 --Monday-2 --Tuesday-3 --Wednesday-4 --Thursday-5 --Friday-6 --Saturday-7 DECLARE @DayOfWeek TINYINT = 1 DECLARE @Date DATETIME =…
user1618825