World Clock

G

Guest

I was wondering if anyone knows of a way to include a world time in a form.

If I click on an employee details I would like to know what time it is in
Singapore based on my system clock - also if someone clicks on myself and
they are in Singapore then it will display my time here to them.

I suppose I would need to make sure daylight savings etc is taken into
account also.
 
W

Warrio

You need a table where you store the number of hours from the GMT time.
ie. Singapore ; -6
NewYork ; +6
Paris ; +1

and with a select query you can display the time depending where the person
is (knowing that the time given by the user system can differ from the GMT)

you need to select the time difference from GMT for the user and his
correspandant.
the calculation will be:
TimeThere = SystemTime + (myTimeDiffrence) + (hisTimeDiffrence)

exemple: I'm in singapoor, and I want to see the time in Paris
ex: TimeThere = 09:00 + (-6:00) + (+1:00)
TimeThere = 04:00

by coding, it will look like:
'Select 1st your and his time diffrence to the GMT the variables
myTimeDiffrence and myTimeDiffrence
TimeThere = CDate(Hour(DateTime.Time) + myTimeDiffrence +
hisTimeDiffrence & ":" & Minute(DateTime.Time) & ":" &
Second(DateTime.Time))
 
G

Guest

Warrio,

thanks for the code.

I am assuming that I will need to know who is using the program though so
that I can use what country they are in - I already have the country. But I
do not have a log in to tell me who is logging in.

Any ideas on a simple login method - not the access security wizard
 
W

Warrio

the easiest would be to get the name of the country where the user is.
so with that you can check on your table. the name of the country is
normally stored in the regional settings in the control panel. how to get
that variable is another question, and I don't know how to get it. maybe you
should open a question about it.

what I know is that you can get the name of the user connected (owner of the
windows profile) with the environment variables
the syntax is:

MsgBox Environ(27) (the number between the parentheses depends on the
computer sittings)

hope it helps..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top