IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to convert GMT to CST/CDT Timezone


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 15, 2015 6:16 pm
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: 1353
Location: Israel

PostPosted: Thu Jul 16, 2015 5:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top