ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Date opcode

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

  • Date opcode

    Hi,

    What is the opcode used in either RPG and RPGLE
    for conversion of date from one format to another format.

    Thanks
    Muthu
    Miles to Go, Before I sleep.

  • #2
    Re: Date opcode

    Please follow this link for the detail answer(s)



    Code:
     V5R2
         /free
    	   numDate = %int(%char(date : *eur0);  //  ddmmyyyy
    	   numTS = %dec(%char(timestamp : *iso0) : 20 : 0);   //yyyymmddhhmmssuuuuuu
         /End Free
    	 
    --------------------------------------------------------------------------------
    	 
    	 V5R1
    	
    	  H bnddir('QC2LE')   
    	  D atoll           pr            20i 0 extproc('atoll')   
    	  D  string                         *   value options(*string)
    	  
         /free 
    	  numDate = atoll(%char(date : *eur0));
         /End Free
    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: Date opcode

      But if both fields are "date data types", format doesn't really matter.


      Eval DateMDY = DateISO

      Works just fine.

      Comment

      Working...
      X