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

UTC Timestamp


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Log Thangavel

New User


Joined: 19 Jan 2018
Posts: 18
Location: USA

PostPosted: Mon Jan 22, 2018 9:04 pm
Reply with quote

Hi,

Pls let me know if we can able to get the UTC time in COBOL through any date time functions with out using DB2
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jan 22, 2018 9:36 pm
Reply with quote

FUNCTION CURRENT-DATE provides a 21-character alphanumeric value with year, month, day, hour, minute, seconds, hundredths of a second, GMT offset sign, GMT offset hours and GMT offset minutes.

This could easily be found in the manual -- why are you not checking there first?
Back to top
View user's profile Send private message
Log Thangavel

New User


Joined: 19 Jan 2018
Posts: 18
Location: USA

PostPosted: Mon Jan 22, 2018 10:07 pm
Reply with quote

Hi,
Thanks for you response. I knew that function already.

The UTC TS am looking for look like this

<timestamp>2018-01-10T15:00:05.216-06:00</timestamp>
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jan 22, 2018 10:56 pm
Reply with quote

Are you SURE you belong on this forum for experts? The difference between the COBOL FUNCTION CURRENT-DATE and what you show in your post are minor format changes and hence well within a competent programmer's wheelhouse. The only real difference is that you would miss the thousandths of a second by using the COBOL function.

Perhaps you should start using Beginners and Students Forum instead of this one since it seems more on your level?
Back to top
View user's profile Send private message
Log Thangavel

New User


Joined: 19 Jan 2018
Posts: 18
Location: USA

PostPosted: Mon Jan 22, 2018 11:18 pm
Reply with quote

Am not sure if you got the question. The last few thousand were the one is missing and was expecting an answer for it

And stop your advices even if you don’t respond
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 23, 2018 12:36 am
Reply with quote

Quote:
The last few thousand were the one is missing and was expecting an answer for it
and yet you did not ask about this -- you asked about getting UTC time in COBOL. Your question was answered; it is not our fault if you did not clearly explain your requirement nor is it our fault if you failed to ask the right question. Note that fractions of a second are NOT required to be part of a timestamp so missing the thousandths of a second still means the COBOL FUNCTION CURRENT-DATE returns a valid timestamp.

Topic locked to prevent any further waste of time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts To get previous month from current ti... SYNCSORT 7
No new posts Calculate with timestamp PL/I & Assembler 19
Search our Forums:

Back to Top