|
Given a week number, e.g. date -u +%W , how do you calculate the days in that week starting from Monday?
Example rfc-3339 output for week 40:
2008-10-06 2008-10-07 2008-10-08 2008-10-09 2008-10-10 2008-10-11 2008-10-12
Started by hendry on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
= 40; $year = 2008; for($day=1; $day<=7; $day++) { echo date('m/d/Y', strtotime($year."W".$week; } // Timestamp of the monday for that week $monday = mktime('0','0','0', $month, $day-$numDaysToMon, $year); $seconds....
|
|
I'm creating a UI that allows the user the select a date range, and tick or un-tick the days of the week that apply within the date range.
The date range controls are DateTimePickers , and the Days of the Week are CheckBoxes
Here's a mock-up of the UI...
Started by Andrew on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Store number of days the total number of days, and subtract one for each of your "skipped" dates every week range in between that contains....
Of week (dow) of first and last date Move first day forward to same dow as last.
|
|
How can I get first and last days of the current week? What I need is some way of filtering a set of objects with NSDate property to leave only ones, that appear on current week, and then filter them by days. Also I need some way to get localized day ...
Started by Farcaller on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For instance if you consider Monday (2) to be the first day, then how many days earlier was it (or would from the original date, you will get the....
Number, calculate the difference between it, and your first day of the week.
|
Ask your Facebook Friends
|
Can anyone find a constant in the .NET framework that defines the number of days in a week (7)?
DateTime.DaysInAWeek // Something like this???
Of course I can define my own, but I'd rather not if it's somewhere in there already.
Update: I am looking for...
Started by Richard Ev on
, 10 posts
by 10 people.
Answer Snippets (Read the full thread at stackoverflow):
The last calendar week of the year is usually for symbols....
I ran a query across the standard libraries, there are calendar weeks that might be shortrer than seven days.
Minute/hour/day, but nothing at the level of a week.
|
|
I want to implement Scrum, but I can't decide on a Sprint length. Ken Schwaber seems to relate that 30 days it the defacto... but I can't imagine waiting 30 days without the possibility of changing direction or reprioritizing.
Our projects usually only...
Started by Jason on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
I really results....
So it was 7 day weeks in a 10 week quarter.
Also, week is more vague, it was on a school project and it wasn't truly scrum.
A month (a month typically has roughly 20 working days in it, give or take).
|
|
I'm trying to get the week range using Sunday as the start date, and a reference date, say $date , but I just can't seem to figure it out.
For example, if I had $date as 2009-05-01, I would get 2009-04-26 and 2009-05-02. 2009-05-10 would yield 2009-05...
Started by Zahymaka on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
$start_date; $day_of_week = date("w", $date); $start = $date - ($day_of_week * $seconds_in_day); $end....
This and subtract it's value as days from the current day to find the beginning of the week.
|
|
I'm looking for an efficient way to persist a set of Days of the Week. In other words, a user will select any number of days from a list of weekdays. The specific date doesn't matter, just the day of the week. I need to store this set of days in a hibernate...
Started by Tauren on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Certainly skip this one!
Hi,
You could use Enum to set up days of the week
public enum DAYS_OF_THE_WEEK_OF_THE_WEEK", joinColumns=@JoinColumn(name="<OWNING_ENTITY_ID_GOES_HERE>") ) public Set<DAYSthis is how....
|
|
How do I iterate over a timespan after days, hours, weeks or months?
Something like:
for date in foo(from_date, to_date, delta=HOURS): print date
Where foo is a function, returning an iterator. I've been looking at the calendar module, but that only works...
Started by sverrejoh on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
), >>> delta=timedelta(days=1)): >>> print day 2007-03-30 2007-03-31 2007-04-01:
from datetime import date, datetime, timedelta def datespan(startDate, endDate, delta=timedelta(days=1
Then you could use it like this....
|
|
We're writing a records management product for schools and one of the requirements is the ability to manage course schedules. I haven't looked at the code for how we deal with this (I'm on a different project at the moment), but nonetheless I started ...
Started by Mike Spross on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
This will also facilitateA possible #4: Why does it need... .
Programmers, but I somewhat doubt that we're going to add an eighth day to the week any time soon of days in a week is 7, I would keep seven columns, perhaps boolean.
|
|
I have an integer stored in a database (SQLAgent Frequency Interval) This integer is actually the sum of the selected days of the week that the schedule is to run The possible values are any combination of these values
Sunday =1 Monday = 2 Tuesday =4 ...
Started by WACM161 on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
", "Saturday" }; int flag = 1 List<string> days = new List<string>(); foreach (string day in days) { if ((value && flag) != 0) { days.Add(day); } flag <<= 1; }
The result is a list of strings_NUMBER() OVER....
|