ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CL command for timestamp

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CL command for timestamp

    Hi

    Is there a CL command to get the system timestamp?

    regards
    Topgun

  • #2
    Re: CL command for timestamp

    No...You get rtvsysval qtime and qdate and do a bunch of substringing...

    also take a look @ CVTDAT you can convert to *ISO format

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: CL command for timestamp

      U CAN USE

      DCL VAR(&VAR) TYPE(*CHAR) LEN(20)
      RTVSYSVAL SYSVAL(QDATETIME) RTNVAR(&VAR)

      Here there no need to get Date and time separately and concatenating ...

      QDATETIME
      ---------------------------
      System date and time. This is the date and
      time for the local system time as a single
      value. Retrieving or changing this value is
      similar to retrieving or changing QDATE and
      QTIME in a single operation. The format of
      the field is YYYYMMDDHHNNSSXXXXXX where YYYY
      is the year, MM is the month, DD is the day, [/LEFT]HH is the hours, NN is the minutes, SS is the
      seconds, and XXXXXX is the microseconds.
      Changes made to this system value take effect
      immediately.
      Thanks,
      Giri

      Comment


      • #4
        Re: CL command for timestamp

        Nice job Giri

        Well Ill be when did they add that one

        As everyone knows I hate cl
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment

        Working...
        X