Jump to content

Time Funcation Help


Recommended Posts

#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

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

_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)

NEWHeader1.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...