Focal Point
[CASE-OPENED] Convert System Time to Local Time Zone with DST

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5707086036

May 08, 2013, 10:30 AM
Joey Sandoval
[CASE-OPENED] Convert System Time to Local Time Zone with DST
We have a production database that stores system times along with different entity timezones. We need a standardized way to convert a system time to any timezone, while also taking into account DST. Does WebFOCUS have a function that we can use to accomplish this?

Our goal is to only display the appropriate local time based on the entities' timezone to our enduser. We are currently hardcoding all report times to Eastern Standard Time.

Thx

This message has been edited. Last edited by: <Kathryn Henning>,




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


May 08, 2013, 01:28 PM
Doug
Isn't the system time relative to the users system? If so, it would be relative to the end-user, wouldn't it?
May 08, 2013, 02:29 PM
Joey Sandoval
No all our system times are stored in UTC - Coordinated Universal Time . We then convert to Eastern using HADD functions. We need to convert the time based on a timezone field defined in our data. Rather than create a long if - else statement to convert timezones with DST, we were hoping there was an easier solution.




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


May 08, 2013, 05:52 PM
Waz
Apart from WebFOCUS functions and DEFINE Functions, could anything be done on the DB side ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 08, 2013, 07:55 PM
John W Price
There are 25 hourly time zones plus 14 half-hour time zones. From these you can compute an offset value to adjust to what ever you need. If you do a lot of this, I would suggest you load all the offsets into a database table and create a schema to read the table. That way you can join to the table to get the offset values whenever you need them. Chapter 18 in the "Dates Book" lists all these values and has some examples on how to use them.



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
May 13, 2013, 01:51 PM
<Kathryn Henning>
Hi Joey,

While we wait to see if another customer can help on this question, please keep us posted on the final solution from your case. Thank you in advance for sharing with all.

Regards,

Kathryn