Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to convert GMT to CST/CDT Timezone

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Tue Jul 14, 2015 9:37 pm    Post subject: How to convert GMT to CST/CDT Timezone
Reply with quote

Hi,
I want to convert GMT to CST/CDT in DB2 (Table Data). The function/logic should work for regular and day light savings also. Please suggest how to perform this conversion.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 15, 2015 5:20 pm    Post subject:
Reply with quote

are you on a mainframe or server version of db2?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 15, 2015 6:16 pm    Post subject: Reply to: How to convert GMT to CST/CDT Timezone
Reply with quote

I'm not DB2 literate, so here goes.

Is your LPAR set for US Eastern Time?

If you issue a COBOL FUNCTION CURRENT-DATE, bytes 17-21 will contain the GMT-Offset to Local. US Eastern Daylight Time is -0400 while Standard Time is -0500 (format "-/+HHMM"). You can also obtain this same offset separately (my own preference) via the LE Callable Service routine "CEEGMTO". Just add 01 HH for Central Time or ignore this altogether if your LPAR is US Central Time.

But, if MVS personnel don't require GMT (entirely possible), then the offset will contain +0000. icon_eek.gif

Use LE Callable Service routine "CEESECS" to convert the GMT to seconds, then adjust these seconds by subtracting the adjusted-offset (converted to seconds). Then use LE Callable Service routine "CEEDATM" to convert the adjusted seconds to your Central Time-Zone date/time stamp of "CCYYMMDDHHMMSS".

If you require Julian-Format, after Calling "CEEDATM" , use FUNCTION INTEGER-OF-DATE followed by FUNCTION DAY-OF-INTEGER, which will yield you your Julian-Date, with a format of "CCYYDDD".

HTH....
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Jul 16, 2015 5:47 pm    Post subject:
Reply with quote

This might work if you are in the said timezone:
Code:
SELECT (my_timestamp_in_gmt + CURRENT TIMEZONE) FROM ...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts help: convert C'00AB' to X'00AB' alan_gu DFSORT/ICETOOL 1 Thu Sep 29, 2016 12:22 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us