Monday, 1 January 2018

%Date Example

      * Program     :·DateR
      * Description :·%Date() Example
      *
      * %Date(Parm1 { : Parm2 })
      *
      * Input  Parm1:·Integer, Character
      *        Parm2:·Date format
      *
      * Output      :·Date for given value
      *
      * Note        :·%Date always returns date in *ISO format
      *               *ISO - YYYY-MM-DD
      *==========================================================
      *
     C
      /Free
           Dsply %Date() ;                // Today's Date

        // ------------------------------------------------------
        // Convert number to date
        // ======================================================
           Dsply %Date(20120405) ;        // 2012-04-05

           Dsply %Date(01022011 : *USA) ; // 2011-01-02

           Dsply %Date(1120311 : *CYMD) ; // 2012-03-11
        // ------------------------------------------------------
        // Convert char to date
        // ======================================================
           Dsply %Date('2012-04-05') ;        // 2012-04-05

           Dsply %Date('02032011' : *USA0) ;  // 2011-02-03

           Dsply %Date('01/04/2012' : *USA/) ; // 2012-01-04

           Dsply %Date('1120311' : *CYMD0) ;  // 2012-03-11
      /End-Free
     C                   SetOn                                        LR

No comments:

Post a Comment