Nahuel 1 Posted October 26, 2007 (edited) -edit-Does not work anymore. www.timeanddate.com blocked scripting. Can't be bothered to fix it...Just wanted to share this with you all, since I think it turned out pretty nice Simple to use:At first run, you'll need to select your location. Otherwise, you'll get argie-land's time.Press "Refresh" to get the time again, although it does it every 20 secondsIf you want to update it, click "Update" and your computer's clock will be set with the right timeIf the GUI is visible, it will just show you the info. If it's hidden, then it will check every 20 seconds to see if the clock is correct. If it isn't, it will automatically update it.It supports the following cities:expandcollapse popupAddis Ababa Halifax New Delhi Adelaide Hanoi New Orleans Aden Harare New York Algiers Havana Odesa Amman Helsinki Oslo Amsterdam Hong Kong Ottawa Anadyr Honolulu Paris Anchorage Houston Perth Ankara Indianapolis Philadelphia Antananarivo Islamabad Phoenix Asuncion Istanbul Prague Athens Jakarta Reykjavik Atlanta Jerusalem Rio de Janeiro Auckland Johannesburg Riyadh Baghdad Kabul Rome Bangkok Kamchatka San Francisco Barcelona Karachi San Juan Beijing Kathmandu San Salvador Beirut Khartoum Santiago Belgrade Kingston Santo Domingo Berlin Kiritimati Sao Paulo Bogota Kolkata Seattle Boston Kuala Lumpur Seoul Brasilia Kuwait City Shanghai Brisbane Kyiv Singapore Brussels La Paz Sofia Bucharest Lagos St. John's Budapest Lahore St. Paul Buenos Aires Lima Stockholm Cairo Lisbon Suva Canberra London Sydney Cape Town Los Angeles Taipei Caracas Madrid Tallinn Casablanca Managua Tashkent Chatham Island Manila Tegucigalpa Chicago Melbourne Tehran Copenhagen Mexico City Tokyo Darwin Miami Toronto Denver Minneapolis Vancouver Detroit Minsk Vienna Dhaka Montevideo Vladivostok Dubai Montgomery Warsaw Dublin Montreal Washington DC Edmonton Moscow Winnipeg Frankfurt Mumbai Yangon Geneva Nairobi Zagreb Guatemala Nassau ZürichAnd the code:Time_Updater.zipLots of thanks to Smoke_N, whose script happens to be the heart of this app.I hope you guys like it. Any feedback/comments/critics are welcomed. -edit-Also, excuse the comments in Spanish, probable typos and unnecessary lines in the code. Edited August 22, 2008 by Nahuel Share this post Link to post Share on other sites
gseller 1 Posted October 26, 2007 Very Nice job, I had to go out to www.timeanddate.com/worldclock and get my closest city location to correct my time. It changed it just looking.. LOL My fault for not looking closesly. Great job on the GUI and tray menu. Share this post Link to post Share on other sites
gseller 1 Posted October 26, 2007 Very Nice job, I had to go out to www.timeanddate.com/worldclock and get my closest city location to correct my time. It changed it just looking.. LOL My fault for not looking closesly. Great job on the GUI and tray menu. Share this post Link to post Share on other sites
Nahuel 1 Posted October 26, 2007 Thanks, I love the GUI effects too But what do you mean It changed it just looking..? Share this post Link to post Share on other sites
gseller 1 Posted October 26, 2007 Oh, Nothing. It changed my time like you said it would. I had to get my closest city and ad it to the config for Oklahoma City for the correct time. No biggy.. Share this post Link to post Share on other sites
Ibrahim 0 Posted October 28, 2007 Where is EGYPT !!!!!!!!!!!! [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Share this post Link to post Share on other sites
Nahuel 1 Posted October 28, 2007 Where is EGYPT !!!!!!!!!!!! It's by city, not country. And Cairo is right there. According to this map, Egypt belongs to the GMT+2 time zone. Share this post Link to post Share on other sites
Ibrahim 0 Posted October 30, 2007 Thanks man it's great [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Share this post Link to post Share on other sites
GEOSoft 68 Posted November 6, 2007 This is very good. To avoid using Argentina as the default I have a function I was working on that I was going to add into my version of Date.au3. You can use any portion you need. You probably don't even need to keep the Time zone selection if you use this. Just use GMT and the local time zone as set by the bias offset ($tzBias). Remember the offsets are in minutes from GMT so divid by 60 for hours. expandcollapse popupFunc _Date_GetTimeZoneInfo() $strComputer = "localhost" $objT_Zone = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $tzItems = $objT_Zone.ExecQuery("SELECT * FROM Win32_TimeZone", "WQL", 0x10 + 0x20) If IsObj($tzItems) then For $objItem In $tzItems With $objItem Global $tzBias = .Bias;; Time Zone Bias given in minutes from GMT (Use .Bias/60 to get Hours) Global $tzCaption = .Caption;; Time Zone Caption Global $tzDesc = .Description;; Time Zone Description (usually same as Caption) Global $setID = .SettingID;; Setting ID (not usually used) Global $dName = .DaylightName;; $Daylight Savings Name Global $dBias = .DaylightBias;; Daylight Savings Bias (in minutes) Global $dDay = .DaylightDay;; Daylight Savings Day Global $dWDay = .DaylightDayOfWeek;; Daylight Savings Day of Week Global $dYear = .DaylightYear;; Daylight Savings Year Global $dMon = .DaylightMonth;; Daylight Savings Month Global $dHour = .DaylightHour;; Daylight Savings Hours Global $dMin = .DaylightMinute;; Daylight Savings Minutes Global $dSec = .DaylightSecond;; Daylight Savings Seconds Global $dMsec = .DaylightMillisecond;; DayLight Milliseconds Global $sName = .StandardName;; Standard Time Name Global $sBias = .StandardBias;; Standard Time Bias (in minutes) Global $sDay = .StandardDay;; Standard Time Day Global $sWDay = .StandardDayOfWeek;; Standard Time Day Of Week Global $sYear = .StandardYear;; Standard Time Year Global $sMon = .StandardMonth;; Standard Time Month Global $sHour = .StandardHour;; Standard Time Hours Global $sMin = .StandardMinute;; Standard Time Minutes Global $sSec = .StandardSecond;; Standard Time Seconds Global $sMsec = .StandardMillisecond;; Standard Time Milliseconds EndWith #cs; For display only $Output="" $Output &= "Computer: " & $strComputer & @CRLF $Output &= "==========================================" & @CRLF $Output &= "Bias: " & $tzBias & " minutes from GMT" & @CRLF & "Caption: " & $tzCaption & @CRLF $Output &= "Description: " & $tzDesc & @CRLF & "SettingID: " & $setID & @CRLF & @CRLF $Output &= "Daylight Name: " & $dName & @CRLF & "Daylight Bias: " & $dBias & @CRLF & "Daylight Day: " & $dDay & @CRLF $Output &= "Daylight Day of Week: " & $dWDay & @CRLF & "Daylight Year: " & $dYear & @CRLF & "Daylight Month: " & $dMon & @CRLF $Output &= "Daylight Hour: " & $dHour & @CRLF & "Daylight Minute: " & $dMin & @CRLF & "Daylight Second: " & $dSec & @CRLF $Output &= "Daylight Millisecond: " & $dMsec & @CRLF & @CRLF $Output &= "Standard Name: " & $sName & @CRLF & "Standard Bias: " & $sBias & @CRLF & "Standard Day: " & $sDay & @CRLF $Output &= "Standard Day Of Week: " & $sWDay & @CRLF & "Standard Year: " & $sYear & @CRLF & "Standard Month: " & $sMon & @CRLF $Output &= "Standard Hour: " & $sHour & @CRLF & "Standard Minute: " & $sMin & @CRLF $Output &= "Standard Second: " & $sSec & @CRLF & "Standard Millisecond: " & $sMsec & @CRLF $Output &= "==========================================" If Msgbox(1,"Time Zone Info",$Output) = 2 then ExitLoop $Output="" #ce Next Endif EndFunc ;<===> _Date_GetTimeZoneInfo() HTH GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites
Nahuel 1 Posted November 6, 2007 Wow, that's a kickass function. I'd love to use it in my script, but I don't really know how... Your function returns lots of information and it seems to me that the only thing I could use is the 'Time Zone Bias given in minutes from GMT', but then I'd have to know what's the time zone for each city? Is there an easier way? Share this post Link to post Share on other sites
GEOSoft 68 Posted November 6, 2007 As I pointed out that function was work in progress. The Month and day settings shown are for setting DST start stop dates. Set $nZone to 211 which is the only city in your list which is on GMT all year. Calculate the local time using $tzBias I also changed you Warning Msg to "the program will use: & @CRLF & $tzCaption & @CRLF" Also played with your main msg loop a bit. While 1 $sTime = _NowTime() If GUICtrlRead($HoraPC) <> $sTime Then GUICtrlSetData($HoraPC, $sTime) Rest of your loop WEnd GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites
weaponx 16 Posted November 6, 2007 Is there something wrong with Windows builtin time synchronization? Share this post Link to post Share on other sites
Nahuel 1 Posted November 6, 2007 While 1 $sTime = _NowTime() If GUICtrlRead($HoraPC) <> $sTime Then GUICtrlSetData($HoraPC, $sTime) Rest of your loop WEnd That's good, but I didn't want that because I wanted both the PC time and the one from the website to be refreshed at the same time. But it doesn't really make a big difference. I'll play with your function and I'll see what I can do, thank you @weaponx: I don't have that... my other computer does but it never worked. Besides, this one can be running all the time checking if your clock is correct every now and then... Share this post Link to post Share on other sites
GEOSoft 68 Posted November 6, 2007 Then why not GUICtrlSetData($HoraPC, _NowTime()) ahead of the loop so the script starts with the current sysem time? GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites
Nahuel 1 Posted November 6, 2007 Sure, why not. As I said, it wouldn't make a big difference What I wanted to do is refresh them both at the same time so the time from the PC and the website are obtained and displayed at the same time, making a bit more accurate. Share this post Link to post Share on other sites
GEOSoft 68 Posted November 7, 2007 It will still do that. It just makes it look a bit better if there is something displayed as soon as the app fires up, especially if the app is run before a net connecion is established. GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!" Share this post Link to post Share on other sites
Nahuel 1 Posted November 8, 2007 yeah.. that's true I'll do it. Share this post Link to post Share on other sites