Ask a Question

Anyone know how to get Unix Time using DelphiScript?

SOLVED
akuczkowski
Contributor

Anyone know how to get Unix Time using DelphiScript?

I need the current datetime formatted as Unix time (the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970). Anyone know how to get that value? We are using TestComplete 11 and DelphiScript.

 

Thanks,

Adam

1 ACCEPTED SOLUTION

Accepted Solutions
akuczkowski
Contributor

Re: Anyone know how to get Unix Time using DelphiScript?

Sorry to answer my question, but it turned out this was easy to calculate using TestComplete DateTime methods.

 

iUnixTimeInDays := aqConvert.VarToFloat(aqDateTime.TimeInterval(Now(), aqDateTime.SetDateTimeElements(1970,1,1,0,0,0)));
iUnixTimeInSeconds := iUnixTimeInDays * 24 * 60 * 60;

View solution in original post

1 REPLY 1
akuczkowski
Contributor

Re: Anyone know how to get Unix Time using DelphiScript?

Sorry to answer my question, but it turned out this was easy to calculate using TestComplete DateTime methods.

 

iUnixTimeInDays := aqConvert.VarToFloat(aqDateTime.TimeInterval(Now(), aqDateTime.SetDateTimeElements(1970,1,1,0,0,0)));
iUnixTimeInSeconds := iUnixTimeInDays * 24 * 60 * 60;

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: