Advertise here: Contact FM.
SPANs are all UTC dates as well, using the query column: DATEDIFF(second, '19700101', date), where date is the column that holds the timestamp when the article was posted.cs_Offset = [injected server current date_UTC] - parseInt(new Date().getTime()/1000, 10);
localOffset = d.getTimezoneOffset() * 60000;
newUTC = post_UTC_timestamp - cs_Offset;
d = new Date(newUTC*1000 + localOffset);
newDateString = d.toLocaleString();SELECT DATEDIFF(second, '19700101', DATEADD(second, DATEDIFF(second, GETDATE(), GETUTCDATE()), date)) as utc ...new Date(utcdate).toLocaleString().
I'm always making things more difficult for myself.DECLARE @ServerOffset DATETIME
SET @ServerOffset = DATEDIFF(second, GETDATE(), GETUTCDATE())
SELECT DATEDIFF(second, '19700101', DATEADD(second, @ServerOffset, date)) as utcdate
posted by intermod at 8:36 PM on August 31, 2006