|
How to determine dates by number of days from now - "What date is 180 days from now?"
Started by Kip Birgen on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
SELECT DATEADD(day, 180, getdate())
DATEADD(d, 180, GetDate())
getdate() + 180
for example:
select getdate() as Today, getdate() + 180 as About6MonthsLater
Since you just want the date, the time DATEADD(day, DATEDIFF(day....
|
|
I have a system that compares fiscal year up to the current date to the same date range of the year before. You can adjust the year and month to look at and it always compares the same date range to the year previous. I have it set so if the current day...
Started by John Isaacks on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Yesterday", $from_unix_time); $formatted = date('Y-m-d', $day_before);
I think it depends as the "up to" date) or do they want to see day 1 of this fiscal year compared to day 1 of last? You, $month and $day....
|
|
What's the easiest way to compute the amount of working days since a date? VB.NET preferred, but C# is okay.
And by "working days", I mean all days excluding Saturday and Sunday. If the algorithm can also take into account a list of specific 'exclusion...
Started by Matias Nino on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
DateDiff along with a few other Date* functions are unique to VB.NET and often day calc: http://www.codeproject.com/KB/cs/datetimelib.aspx
Calculating Holidays: http of holiday dates that fall with the ....
Of a list of holidays.
|
Ask your Facebook Friends
|
Hi
I need to calculate date (year, month, day) which is (for example) 18 working days back from another date. It would be enough to eliminate just weekends.
Example: I've got a date 2009-08-21 and a number of 18 workdays as a parameter, and correct answer...
Started by Jhon on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Not as efficent you're using datetime....
Figure out what day of the week a certain date is, and then you can calculate back - taking into account weekends
I would probably just loop over the days checking if the day is mon-fri.
|
|
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):
By the time you figure out whether a day lands on one of the partial will be more....
Store number of days that contains one of those days.
Of week (dow) of first and last date Move first day forward to same dow as last.
|
|
Hello
I would like to sort a list of 1500 files in XSLT 1. The list is similar to:
01052003.xls -> (translate to: 1th of May 2003) 25062004.xls -> (translate to: 25th of June 2004) 31032001.xls -> (translate to: 31th of Marts 2001)
I can do a...
Started by Tillebeck on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Three sort keys based on the year, month, and day substrings of the date string:
<xsl:template:sort select="substring(@hireDate,3,2)"/><!-- day --> </xsl:apply-templates> </xsl:template>
What about reverse....
|
|
In SQL Server what is the simplest/cleanest way to make a datetime representing the first of the month based on another datetime? eg I have a variable or column with 3-Mar-2005 14:23 and I want to get 1-Mar-2005 00:00 (as a datetime, not as varchar)
Started by Rory on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The second parameter (the 0) represents the 0 date in SQL, 1900, then adds that number of months....
DateDiff returns an integer.
SELECT DATEADD(mm, DATEDIFF(mm, 0, @date), 0)
Select DateAdd(Month, DateDiff(Month, 0, GetDate is with DateDiff.
|
|
Let me know :)
$add_date = date ("Y-m-d H:m:s"); $expiry_date = 'how?';
How to insert into db the $expiry_date for 60 days. mysql format is datetime
Started by bob on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Use strtotime() :
$start_date = date('Y-m-d H:m:s'); $end_date = date('Y-m-d H:m:s', strtotime("+60 days"));
or more simply:
$end_date = date('Y-m-d H:m:s', time() + 86400 * 60);
A method avoiding time....
|
|
Trying to select a date (x) days from today's date, where the date would be start of day (e.g. 12:00am that day).
For example, a query with date 5 days earlier..
@"select pkey, dateofmod from data WHERE dateofmod >= date('now', '? days')" , [NSNumber...
Started by Jordan on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
@"select TOP X from data WHERE dateofmod >= date('now', '? days')" , [NSNumber numberWithInt:-5];
Is this what you need?
sqlite> SELECT date( julianday(date('now'))); 2009-08-19 sqlite&....
You can always do slect Top X.
|
|
I have publish up date and publish down date in my DB. Currently they are both same dates.
How do I change it (during mysql insert) so publish down date is 30 days past publish up date.
I am using $pubDate
Thanks
Started by Ossi on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use DATE_ADD() :
DATE_ADD(my_date, INTERVAL 30 DAY)
in php, before inserting you can use strtotime(): if the publishDown date is a timestamp:
$publishDown = strtotime("+30 days",$publishDown.
|