silchester
asked on
Convert Datetime To UTC
I want to convert an _arbitrary_ smalldatetime into its equivelent UTC.
I do not want to convert the current time to UTC.
(Not wanting to refer to the current time at all, that is why I believe the getUTCDate() function is not applicable.)
So, given: '9/22/2009 1:25:00 PM' I would expect an integer representing the UTC.
Cheers
I do not want to convert the current time to UTC.
(Not wanting to refer to the current time at all, that is why I believe the getUTCDate() function is not applicable.)
So, given: '9/22/2009 1:25:00 PM' I would expect an integer representing the UTC.
Cheers
http://geekswithblogs.net/ewright/archive/2004/09/14/11180.aspx
ASKER
Hi
I have seen this, but the code does not return an integer representing the seconds since the UTC epoch.
still no success unfortunately
I have seen this, but the code does not return an integer representing the seconds since the UTC epoch.
still no success unfortunately
smalldatetime is counted from 01.01.1900 00:00 and it is rounded to minutes. To call it UTC epoch is not accurate. The number of seconds since smalldatetime beginning will cause numeric overflow when converted to int data type.
You should decide either to convert it to bigint or to calculate number of minutes instead of seconds.
You should decide either to convert it to bigint or to calculate number of minutes instead of seconds.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.