creating world clock

need help

hi,

I want to make a worlde clock with 5region  at the same time but there is a problem that I want to know how to syc the time  from server, how can I loocate the server for time sync. Plz help.

13,502 views 12 replies
Reply #1 Top

You might try looking at the vbscript here: http://community.spiceworks.com/scripts/show/467-sync-system-time-with-internet-time-server

Reply #2 Top

thanks for reply but please would you help me how to use it with desktopX with various type of text (digital) clocks. like gmt est pst. etc.? 

Reply #4 Top

or Please tell me how to add +5 or -3 in system time I need just Text based clocks Please help me it is urgent. 

Reply #5 Top

Hi, I know its not a dx gadget, but there is a free portable application you can get called Qlock that will allow you to display up to 5 timezones on your desktop and also sync them via the internet http://www.qlock.com/ just scroll down on the download page and at the bottom is the free version

Reply #6 Top

Thanks Dear

I know about  Qlock and currently we are using this but we want to make some thing with our own... I have found a DesktopX gadget on Wincustomize by searching world Clock in DesktopX section in which  there is a pop up window to set the time and that is showing Analog clock but I want to make just text based clock isn't it possible in DesktopX ???

Reply #7 Top

Put the following script into a text object:

Sub Object_onscriptenter
 object.SetTimer 1, 1000
End Sub

Sub object_ontimer1
 t = FormatDateTime(time(),3)'---Get your system time
 setclock = FormatDateTime(Dateadd("h",6,(t)),3)'---Add 6 hours to your system time
 object.text = setclock
End Sub

 

The setclock line can be modified to however many hours ahead or behind you want to set the clock to. Simply change the 6 to +/- any number.

For example, 8 hours behind your system time would be:  setclock = FormatDateTime(Dateadd("h",-8,(t)),3)

 

For further information check out these tutorials and articles:

SCRIPTING 101

SCRIPTING TIME

ANALOG CLOCK (where I got the snippet of code above)

 VBSCRIPT DATE/TIME FUNCTIONS (such as FormatDateTime and Dateadd)

+1 Loading…
Reply #8 Top

 

Thanks A lot Sviz,

I knew you may help me but there is another query that if I want to add minutes as well  so what to do like my system time is 11;10 I want to add 4:30 to it so should I use

 

Code: vbscript
  1. setclock = FormatDateTime(Dateadd("h",6,m,30(t)),3)'

 

Please Reply.

Reply #9 Top

You need to add a second line after the first 'setclock'

 

Sub Object_onscriptenter
 object.SetTimer 1, 1000
End Sub

Sub object_ontimer1
 t = FormatDateTime(time(),3)'---Get your system time
 setclock = FormatDateTime(Dateadd("h",6,(t)),3)'---Add 6 hours to your system time
 setclock = FormatDateTime(Dateadd("n",30,(setclock)),3) '--Add 30 minutes to the previous line
 object.text = setclock
End Sub

+3 Loading…
Reply #10 Top

Dear Sviz

Thank you so very much brother. May God bless you. :D 5*

Reply #11 Top

You're welcome.:)

P.S.: That would be 'sister'. ;)