ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

date timestamp

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

  • date timestamp

    Hello,

    I need to put a date/timestamp value into a numeric field (14,0) in rpg free. Any examples would be appreciated.

    Thanks,

    SLABADIE


  • #2
    Re: date timestamp

    PHP Code:
       d This            s             14  0                      
       
    /Free                                                     
                                                                 
        This 
    = (  %Uns( %Char( %DAte():*Iso0) ) * 1000000)  +    
                  %
    UNS( %Char( %TIME():*HMS0) ) ;                
        *
    InLr = *On;                                             
       /
    End-Free 
    Results in "THIS = 20060911145331"
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: date timestamp

      Thanks Deadman. I'll give that a try.

      SLABADIE

      Comment


      • #4
        Re: date timestamp

        u can also use this ..

        D CharTimestamp S 14A
        D numtimestamp S 14S 0
        D

        /Free

        CharTimestamp = %Char(%Timestamp():*ISO0) ;
        numTimestamp = %Uns(CharTimestamp)
        /End-Free
        Thanks,
        Giri

        Comment


        • #5
          Re: date timestamp

          Thanks Giri, it's good to know there's a few different ways to retrieve a date/time stamp. I'll try this example out also.

          Comment


          • #6
            Re: date timestamp

            Ya just gotta love having OPTIONS!!!

            Great job guys!!

            Comment

            Working...
            X