# local time and time zone calculations

I have a table of cities we work with.  Each column represents a time zone.  At the top of each column, I have  computed text to display the current day and time.  I'm using @Adjust in my time calculations, and it works great in my own time zone.  However, it doesn't travel well.

How can I compute the time for a specific time zone?  Something like @Now(GMTtimezone).
LVL 1
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Hi SandraE,

Use @Zone(timeDateValue) to get the offset from "GMT" (GMT is no longe the true standard, but that is an esoteric discussion not relevant to solving your problem).

Once you compute teh zone offset, you can of course use @Adjust to convert it to another offset.

Ah, but how to find the offset amount of a different timezone?  Build a text string to contain a time based in a specific time zone.  Use @TextToTime to convert that to a date-time value. Use @Zone to discover the "GMT" offset of that zone. Adjust accordingly.

For example, I am in NY, which is EST.  LA is in Pacific time, or PST.

local := @Zone(@Now) return 5 (you will need to handle daylight savings differently)
remote := @Zone(@TextToTime("1/1/2001 1:00 AM PST")) returns 8 -- it would be 4 AM EST.
dif := local - remote returns -3 (3 hour time difference, remote location is earlier)
@Now reurns 10/30/2003 2:04:15 AM
@Adjust(@Now; 0; 0; 0; -5; 0; 0) returns 10/29/2001 11:04:15 AM

Best regards,
qwaletee

Experts Exchange Solution brought to you by