Converting time to UTC

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
wcks
Newbie
Posts: 5
Joined: Fri Oct 09, 2009 9:06 pm

Converting time to UTC

Post by wcks » Fri Jan 15, 2010 9:54 am

Does anybody know a trick to convert current time to UTC (the number of seconds since at 01-01-1970 00:00:00 ) ?

Thanks,
Wcks

wcks
Newbie
Posts: 5
Joined: Fri Oct 09, 2009 9:06 pm

Post by wcks » Fri Jan 15, 2010 10:12 am

Got it.

Using VBscript:

Function getUTC
timeStart = "1/1/1970 12:00:00 AM"
timeUTC = datediff("s", timeStart, now())
getUTC = timeUTC
End Function
Wcks

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

DateDiff an alternative to Timer

Post by gdyvig » Fri Jan 15, 2010 3:20 pm

Hi wcks,

The DateDiff function is a good alternative to the Timer function often referred to in the forums. The advantage of DateDiff is it gives a correct elapsed time when you pass midnight.


Gale

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts