datetime-operation

performing datetime related operations in PHP

how do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? i personally started to pass some of these operations to my postgresql dbms as typically i would only need to issue one sql statement to obtain an answer, however, to do it in PHP way I would ...

how to convert from prtime to .net datetime

I want to convert a number that is in PRTime format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a datetime. note that this is slightly different than the usual "number of millisecconds since 1/1/1970" ...

What is the correct way of getting the start and end date of a ISO week number in TSQL?

I have the ISO week and year but how do I correctly convert that into two dates representing the start and end of that week? ...

How to convert DateTime to VarChar

I am working on a query in Sql Server 2005 where I need to convert a value in DateTime variable into a varchar variable in 'yyyy-mm-dd' format (without time part). Please help, thanks. ...

C# - What is the best way to get a list of the weeks in a month, given a starting weekday?

I need to get a list of weeks for a given month, with Monday as the start day. So for example, for the month of February 2009, this method would return: 2/2/2009 2/9/2009 2/16/2009 2/23/2009 ...

How to get the same time and Day next month using DateTime in c#

I have a c# DateTime object and I need to increment it by one month. example: input output ------------------------------- Jan 12, 2005 Feb 12, 2005 Feb 28, 2009 Mar 28, 2009 Dec 31, 2009 Jan 31, 2010 Jan 29, 2000 Feb 29, 2000 Jan 29, 2100 Error: no Feb 29, 2100 What is the best way to do this. My first thou...

What is a good way to determine dates in a date range?

What is a good Perl module (or good approach) that returns all the valid calendar dates between a start date and an end date? For example, if I have 1/29/2009 as a start date and 2/3/2009 as an end date then I would like it to return an array of 1/30/2009, 1/31/2009, 2/1/2009, and 2/2/2009. There must be a good Perl module that already...

Failed to convert parameter value from a TimeSpan to a DateTime

Hi, I am using SQL Server 2008. First I gave SqlDbType.Time for System.TimeSpan to the parameter type for Insert and Update. I works successfully. Now I changed to DbType.Time instead of SqlDbType.Time. Which gave me the error message "Failed to convert parameter value from a TimeSpan to a DateTime" which didn't call the "Procedure" ...

Concatenate a date and time value

Hi, i need to concatenate a date value and a time value to make one value representing a datetime in javascript. thanks, daniel ...

php: datetime arithmetic

I'm a bit stuck with the DateInterval class of PHP. What I really want is the number of seconds elapsed between two DateTime stamps. $t1 = new DateTime( "20100101T1200" ); $t2 = new DateTime( "20100101T1201" ); // number of seconds between t1 and t2 should be 60 echo "difference in seconds: ".$t1->diff($t2)->format("%s"); Yet all I ...