Solved

local time and time zone calculations

Posted on 2003-10-29
4
245 Views
Last Modified: 2013-12-18
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).
0
Comment
Question by:SandraE
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 9648164
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
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9648180
Note:

You need special andling for daylight savings time and for "partial hour offsets" (time zones where for example the offset is 5,5 hours instead of 5 or 6, or even 5,25 or 5,75 -- there are a few such zone)

Red up on @Zone to determine these differences.  Particular trouble can be had when trying to match one DST to another DST, or for that matter, a DST to a non-DST and a non-DST to a DST.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question