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
2 answers

Convert daily to weekly where week starts on every Tuesday in R

Here is the code: EDIT: SEE REPRODUCIBLE CODE BELOW >require("quantmod") > > corn <- as.xts(read.zoo("~/CORN.csv", sep=",", format ="%m/%d/%Y", header=TRUE)) > > head(corn) [,1] 1962-01-03 4.03 1962-01-04 3.99 1962-01-05…
Milktrader
  • 9,278
  • 12
  • 51
  • 69
2
votes
0 answers

Day of week is off by one by one day Android-times-square

We are facing an issue for the day off for the calendar by one day when the timezone is set to AUTO mode in Samsung S7. Even after the few hours calendar is showing the perfect dates with days. For your reference, I am attaching the screenshot for…
Kishan sharma
  • 701
  • 1
  • 6
  • 20
2
votes
2 answers

How to check if the current day is TRUE or FALSE in a binary representation of the days of the week in PHP

I have a character string representing the days of the week in a "binary" format. Example: 1001110. In this example: Monday is TRUE, Tuesday, FALSE, Wednesday FALSE, Thursday TRUE, Friday TRUE, Saturday TRUE, Sunday FALSE How to determine if the…
Joel
  • 192
  • 12
2
votes
0 answers

Rails: ActiveRecord Day of Week

Is there any way to query a table with ActiveRecord with a Day Of week condition ? In the way that it can be compatible with all RDBMS ? E.g. : Event.where("DAYOFWEEK(created_at) = 2") This example would work with MySQL but wouldn't with Postgres,…
Alexis Darnat
  • 581
  • 6
  • 13
2
votes
4 answers

Best way to store days of the week in a single column

I have a notifications table where someone can set which days of the week to be notified: sun mon tue wed thu fri sat Now I could create these as individual columns of type bool. Is there a clean of storing these in a single column? I will need to…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
2
votes
1 answer

Get weekdays in order by locale

I'm trying to see if we can get the weekdays in order by locale. For example in US locale, we'll start with Sunday, while FR will start with Monday (in the terms of Calendar). To make sense out of it, I'm making an alarm app with the weekdays where…
Meep
  • 501
  • 6
  • 24
2
votes
1 answer

Start a cron on the 5th business day of the month and run daily after

I am wondering if this is even possible. I would like my job to start running daily on the 5th business day until the end of the month, every month. ex Aug - 7-31 Sep - 7-30 Oct - 4-31 Is this even possible? Thanks in advance
Mindbender
  • 41
  • 1
  • 6
2
votes
2 answers

calculate week number by changing the start of week in r

I'm trying to count the week number by shifting the start of the week from day 7 (in lubridate, the default Sunday = 7) to day 5 (Friday) Note: If you get the day of week numbers with wday function from lubridate, it will return 1 for Sunday and 6…
Todd Shannon
  • 527
  • 1
  • 6
  • 20
2
votes
2 answers

Java Calendar.DAY_OF_WEEK gives wrong day

What is wrong with the below code? It gives wrong day for any date of the year. import java.util.Scanner; import java.util.Calendar; public class Solution { public static String getDay(String d, String m, String y) { String[] days =…
user3050866
  • 33
  • 1
  • 5
2
votes
2 answers

Convert Unix Timestamp to week day

I know here is a similar question but I could not apply this to my code. Don't know where to put it and different result needed. success: function(data){ var table = ''; var header = '

' + data.city.name + ', ' +…

2
votes
2 answers

Display tomorrow's name in javascript?

I am trying to output something similar to the following on our ecommerce website: Order by 5pm today for dispatch on Monday Obviously, the word Monday would be replaced by the name of the next day (ideally the next working day i.e. not Saturday or…
dannymcc
  • 3,744
  • 12
  • 52
  • 85
2
votes
3 answers

PLSQL - How to find Monday and Friday of the week of a given date

I have spent days trying to figure this out to no avail, so hopefully someone can help me. I have a queried date set which contains several fields including a column of dates. What I want to do is create a new field in my query that tells what the…
Melanie
  • 23
  • 1
  • 1
  • 5
2
votes
1 answer

iPhone - how may I check if a date is Monday?

I'm trying to find if a date is Monday. To do this I proceed this way : #define kDateAndHourUnitsComponents NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit NSCalendar…
Oliver
  • 23,072
  • 33
  • 138
  • 230
2
votes
2 answers

Get vector of Tuesdays, but if Tuesday falls on a holiday, then replace it with Wednesday in R

I would like to find all of the Tuesdays between two dates. But if the Tuesday falls on a user-defined list of holidays, then I would like Wednesday instead. This code works in my tests, but it is pretty janky and I am afraid it will fail…
Richard Herron
  • 9,760
  • 12
  • 69
  • 116
2
votes
1 answer

SQL - Finding working days from days worked

We have a table that contains resources and the days' that they work. For example, one person could work Monday - Friday but another could only work two days of that week. Here is the data: WorkOnSunday WorkOnMonday WorkOnTuesday …
Timmo
  • 2,266
  • 4
  • 34
  • 54