Ah, this is such a complex issue. You need to know:
- the time zone where your server is (which is where you will get the date
and time using Current Time(*)
- the time zone where your user is
- the time zone where you want to know what time it is
- whether it is daylight savings time where your server is
- whether it is daylight savings time where your user is
- whether it is daylight savings time where you want to know what time it
is
This is compounded by the fact that it could be a different DAY in some of
these zones, as they can be on different sides of midnight.
Fortunately, the computer operating system does a lot of this for you. I
use Windows and some time ago asked the excellent people at Orchard
Software to add sys_GetTimeZoneList to Win32API. This allows returns an
array of all time zones with the current GMT offset, taking into account
daylight savings time, etc.
You might be able to get a similar thing from the Mac operating system.
What I do is capture the user's current time zone from the OS when he logs
in. I do this on the server and save it in a table, which I then read
into a variable on the user's session, so I can calculate the time
difference between the user and the server. Then if I need to know the
time in another area, I have an array of time zones from the OS I present
to the user and can calculate the time accordingly.
Once upon a time I used a web service to do this, but when I found it was
all built into the OS, I used that with good results.
Hope this helps -
Bob Miller
Chomerics, a division of Parker Hannifin Corporation
ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It
only should be used or disseminated for the purpose of conducting business with
Parker. If you are not an intended recipient, please notify the sender by
replying to this message and then delete the information from your system.
Thank you for your cooperation."
**
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4d_tech-unsubscr...@lists.4d.com
**