IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 8568
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: 8568
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: 8568
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Timestamp in TCP/IP for Z/VSE JCL JCL & VSAM 0
No new posts how to add date & timestamp to th... DFSORT/ICETOOL 5
No new posts DB2 Timestamp field weird behaviour. DB2 8
No new posts How to get MQPUT Timestamp? Java & MQSeries 3
No new posts row change timestamp DB2 3

Back to Top