Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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: 2504
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: 1250
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 Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us