AzKay Posted October 27, 2007 Posted October 27, 2007 Ive been at this for literally hours, And I still cant figure how to convert this Python code, to AutoIt. import time print "%.2f" % time.time() # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Blue_Drache Posted October 27, 2007 Posted October 27, 2007 Ive been at this for literally hours, And I still cant figure how to convert this Python code, to AutoIt. import time print "%.2f" % time.time() #Include <date.au3> $var = _NowCalc() Msgbox(0,"",$var) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
AzKay Posted October 27, 2007 Author Posted October 27, 2007 I probably shouldve given the return value for it. 1193495987.75 AutoIt, Would return; 2007/10/27 16:41:00 # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Blue_Drache Posted October 27, 2007 Posted October 27, 2007 I probably shouldve given the return value for it. 1193495987.75 AutoIt, Would return; 2007/10/27 16:41:00 Would _TimeToTicks() work? #Include <date.au3> $var = _NowCalc() Msgbox(0,"",$var) $var = StringSplit(StringRight($var,8),":") $var = _TimeToTicks($var[1],$var[2],$var[3]) Msgbox(0,"",$var) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
AzKay Posted October 27, 2007 Author Posted October 27, 2007 (edited) I did some research, Appears its based on this:http://en.wikipedia.org/wiki/Unix_epochTimetoticks didnt work.EDIT::So, Im guessing its, the ammount of seconds since;2004-09-16T23:59:58.75 Edited October 27, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Blue_Drache Posted October 27, 2007 Posted October 27, 2007 (edited) I did some research, Appears its based on this: http://en.wikipedia.org/wiki/Unix_epoch Oh, the current time based on the number of seconds since Epoch, or: Jan 01, 1970. #Include <date.au3> $now = _NowCalc() ConsoleWrite($now & @LF) $epoch = "1970/01/01 0:0:00" $var = _DateDiff("s",$epoch,$now) MsgBox(0,"",$var) Edited October 27, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
AzKay Posted October 27, 2007 Author Posted October 27, 2007 (edited) Epoch, Apparently.Just found this;time( ) Return the time as a floating point number expressed in seconds since the epoch, in UTC. Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls. Edited October 27, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
AzKay Posted October 27, 2007 Author Posted October 27, 2007 Getting closer, python returns; 1193498090 autoit returns; 1193505288 # MY LOVE FOR YOU... IS LIKE A TRUCK- #
AzKay Posted October 27, 2007 Author Posted October 27, 2007 (edited) Got it We were doing it from the systems time, Instead of the GMT.EDIT::Ohsnap.There it was, right in the help file, under "_NowCalc";$iDateCalc = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc()) MsgBox( 4096, "", "Number of seconds since EPOCH: " & $iDateCalc )xD;; Edited October 27, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Blue_Drache Posted October 27, 2007 Posted October 27, 2007 (edited) Ah, my time format was wrong. I use a single zero, not a double zero in the hours/minutes. By the way, that system of time will blow up in like ... 2030 or something when the double-length integer rolls over. Edited October 27, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now