Sardith Posted March 19, 2007 Share Posted March 19, 2007 #include <Date.au3> While 1 Pacific() Sleep(100) WEnd Func Pacific() $Time = _NowTime() $Time1 = $Time - 3 ToolTip($Time1, 0,0, "Current Pacific Time:") EndFunc I live in the EST time zone, Im trying to calc. pacific time by subtracting 3 hours from the current time. All it tool tips is the current hour, being 9 in Pafic time right now. Is there away to just subtract 3 hours from the string, and allow it to display the time -3 hours, with the minutes/seconds. I tried string split but had no luck. Any help would be great. [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font] Link to comment Share on other sites More sharing options...
florisch Posted March 19, 2007 Share Posted March 19, 2007 Well, _NowTime returns a string, right? So split the string with stringsplit(...) into an array, take the hour portion of the array, lets say array[1] and substract 3 like this: int(array[1]) -3. Then put the string together again (array[1] & ":" & ...) Link to comment Share on other sites More sharing options...
Developers Jos Posted March 19, 2007 Developers Share Posted March 19, 2007 _DateAdd("h",-3,_NowCalc()) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted March 19, 2007 Share Posted March 19, 2007 _DateAdd("h",-3,_NowCalc()) Yepper, I just went a little further #include <Date.au3> While 1 Pacific() Sleep(100) WEnd Func Pacific() ;$Time = _NowTime(3) ;$Time1 = $Time - 3 $Time1 = _DateAdd( 'h',-3, _NowCalc()) ToolTip($Time1, 0,0, "Current Pacific Time:") EndFunc ; might want to look at the display like this also MsgBox( 4096, "Pc Long format", _DateTimeFormat( _NowCalc(),1)) MsgBox( 4096, "Pc Short format", _DateTimeFormat( _NowCalc(),2)) 8) Link to comment Share on other sites More sharing options...
Sardith Posted March 19, 2007 Author Share Posted March 19, 2007 Thank you all. [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font] Link to comment Share on other sites More sharing options...
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