Solved

local time and time zone calculations

Posted on 2003-10-29
4
242 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now