Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Getting TimeZone from a Date
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Getting TimeZone from a Date
 Login/Join
 
Member
posted
I am in need of getting the Timezone(AST) portion of -SET &DATEDISP = '10/08/2010 11:11:06 AST';

I am not having much luck finding on how to do this. Did I miss it in the knowledge base? I see how to use HCNVRT but I can't find how to get the TimeZone. Any ideas?

This message has been edited. Last edited by: Kerry,


Jim
Prod: WebFOCUS 7.6.5 CGI - Self Service - AIX 5.2 - IBM DB2 V9
Env 3 Local: DevStudio 7.6.5 Servlet - Self Service - MS Windows XP SP2 - Output: HTML, Excel 2000 and PDF
 
Posts: 21 | Location: Minneapolis, MN | Registered: November 17, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Try this:
-SET &TZ=EDIT(&DATEDISP,'$$$$$$$$$$$$$$$$$$$$$999');

Or you can use SUBSTR.

Hopefully I didn't misunderstand your question.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Jim, if you're doing this in Dialogue Manager, you can use the EDIT or SUBSTR function to extract the 21st to the 23rd character of the date-time string.

But, I imagine your need is more complex than this, so please provide more details.

Thanks,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Like Ginny posted, 10 minutes before me!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Jim,
If you need to get the time zone from a db2 datetime field (or any other dbms for that matter), then sorry, there is no part of the field that indicates a time zone. As far as I know, the only dbms that sort of supports time zones is Oracle. DB2 stores (and returns) dates in the time zone that it derives from the OS where the database resides.
From the internet I got this statement to get DB2 to print the current local time in utc format:
db2 "with t (local_time, utc_time) as ( values (current_timestamp, current_timestamp - current timezone) ) select * from t"
Maybe you can convert this to something that WebFOCUS can handle - if this is what you're looking for. If not, just ignore this post.


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Another option for Dialog Manager or an alpha field is to use GETTOK with a -1 as the token number.

I think more info on the source and format of the data will help.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6068 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Ginny
You hit it right on the head.

Thank you


Jim
Prod: WebFOCUS 7.6.5 CGI - Self Service - AIX 5.2 - IBM DB2 V9
Env 3 Local: DevStudio 7.6.5 Servlet - Self Service - MS Windows XP SP2 - Output: HTML, Excel 2000 and PDF
 
Posts: 21 | Location: Minneapolis, MN | Registered: November 17, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
What type of data are you querying? Does your record have any sort of physical location information you can pull? If so, then maybe you can build a work file that lists the time zones for different physical locations and do a DB_LOOKUP on that table?


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Getting TimeZone from a Date

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.