Retrieve millisecond’s for all 6 positions

230 pts.
Tags:
RPGLE time stamp
Retrieve millisecond's for all 6 positions


A=%timestamp();

will give you this '2019-03-13-11.15.19.653000' but how about the last 3 positions =000. This is needed to help make XML files with a better unique identifier.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    Milliseconds are in the third decimal position. To get more precision you'll need to use something other than the %trimestamp() function.

    To get out to microseconds (6 decimal fraction positions), you could use the gettimeofday()--Get Current UTC Time API. Or you might use the Materialize Time of Day Clock Attributes (MATTODAT) MI built-in.

    If 'uniqueness' is the problem, a timestamp probably isn't a good way to go. A UUID might be a better choice.
    34,430 pointsBadges:
    report
  • ToddN2000
    %timestamp wont go that deep with the milliseconds. You need to do it outside of the RPG code like Raven said. And I agree that although unlikely you would get a duplicate if you took the date/time that far, I would still go with the UUID. 
    131,550 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: