weekday

Equivalent of WeekDay Function of VB6 in C#

I have to convert some of my VB6 Code to C# , In my VB6 I am having code like dim I as Long I = Weekday(Now, vbFriday) I want equivalent of the same in C# Can any one Help ? ...

Get string representation of a sql DateTime day

Hi all, Let's say i have a sql datetime of '1 May 2009' or '12 May 2009'. Is there any built in sql function / operation i can perform on the dates above to return the string representation of the DAY of the date? So for '1 May 2009' i'll get "Friday" as the answer (case not important). For '12 May 2009' i'll get "Tuesday". ...

NSCalendar first day of week

Does anyone know if there is a way to set the first day of the week on a NSCalendar, or is there a calendar that already has Monday as the first day of the week, instead of Sunday. I'm currently working on an app that is based around a week's worth of work, and it needs to start on Monday, not Sunday. I can most likely do some work to w...

Get next date from weekday in JavaScript

Dear coding gurus, would you be so kind and tell me if this is possible in JavaScript to return the next date of given weekday (it could be either a number 0-6 or names Sunday-Saturday). Example, if today, on 16-Oct-2009 I passed in: Friday, it would return today's date 16-Oct-2009 Saturday returned 17-Oct-2009 Thursday returned 22-O...

Joda Time: First day of week??

How do you get the first day of week given a Locale using Joda Time? Point: Most countries use the international standard Monday as first day of week (!). A bunch others use Sunday (notably USA). Others apparently Saturday. Some apparently Wednesday?! Wikipedia "Seven-day week"#Week_number ...

View in Oracle to display rows from last weekday

I need to make a view in Oracle that will display all rows from last weekday. So for Tuesday it should be like this cause I need all entries from Monday: select * from table_1 where to_char(Mydate,'yyyy-mm-dd') = to_char(sysdate-**1**,'yyyy-mm-dd'); But if it is Monday then I need all entries from Friday. select * from table_1 whe...

Java: getting current Day of the Week value

At the moment, I'm creating a java schedule app and I was wondering how to find the current day of the week while using the Calendar class to get the first day of the week. Here is the method I'm using in a class in order to set up a week schedule public static String getSunday() { SimpleDateFormat d = new SimpleDateFormat(dayDate)...

Getting the day from a Unix timestamp (PHP)

How do I get the day (1-7) from a Unix timestamp in PHP? I also need the day date (1-31) and month (1-12). ...

[Solved] Counting the age of an item in weekdays only

I've been trying to count the age of something in weekdays. I've tried the method detailed in this question, http://stackoverflow.com/questions/883615/given-a-date-range-how-to-calculate-the-number-of-weekends-partially-or-wholly-wi but it doesn't seem to fit my usecase. An item has a created DATETIME in the database, and I need to mark...

How to get value within a week of a specified date on mysql

hello, How to get value within a week of a specified date on mysql? Example: date is 04-23-2010. I want to query between start and end of 04-23-2010's week. Thanks! ...

How to find nearest day of week in php?

Hello! How to find a speciefic nearest day of the week in PHP if initially I have a date string like: 07.05.2010? For example, I want to find the nearest Sunday (or any day of the week). How can I implement this? Thanks ...

Check if date is allowed weekday in php?

Hello! I'm stuck with a problem how to check if a specific date is within allowed weekdays array in php. For example, function dateIsAllowedWeekday($_date,$_allowed) { if ((isDate($_date)) && (($_allowed!="null") && ($_allowed!=null))){ $allowed_weekdays=json_decode($_allowed); $weekdays=array(); foreach($allowe...

Objective C - How can i get the weekday from NSDate ???

I need to be able to get the weekday from nsdate, i have the following code and it always return 1. I tried to change the month, i tried everything from 1 to 12 but the result of the week day is always 1. NSDate *date2 = [[NSDate alloc] initWithString:[NSString stringWithFormat:@"%d-%d-%d", 2010, 6, 1]]; unsigned units2 = NSYearCalendar...

Changing first day of the week in NSDateFormatter

In order to get the days of the week I use: NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; NSArray *weekdays = [dateFormatter shortWeekdaySymbols]; Weekdays gives me an array with the days names but it begins by Sunday. For some reasons I want this array to begin by Monday or Sunday depending on the loc...

how can I make sure a day is a weekday in Rails?

I have a message substitution called next_week which basically takes Date.today + 7.days. However, although I still want to send emails on weekends, if the next_week falls on a weekend, I want it to know this and push to the Monday. How do i do this? ...