arpadate-to-ymdhms

function

Library: Date and time functions (OMDATE)
Include: omdate.xin

Returns: Returns the specified date in "YYYYMMDDhhmmss+ZHZM" format.


Declaration
define string function arpadate-to-ymdhms value string arpadate

Argument definitions

arpadate
a date in standard ARPA/Internet RFC-822 format


Purpose

This function takes a date/time in standard ARPA/Internet RFC-822 format and returns it in "YYYYMMDDhhmmss+ZHZM" format. Considerable flexibility is allowed by RFC-822, and additionally, this function allows further laxity in the ARPA date/time format:

Example:


  ; Takes ARPA/Internet RFC-822 date format and returns it in "YYYYMMDDhhmmss+ZHZM" format. 
    include "omdate.xin"
    process
      local stream my-date  ; YYYYMMDDhhmmss+ZHZM format date
      local stream input-arpadate initial {"20 Feb 01 21:38:23"}
      set my-date to arpadate-to-ymdhms input-arpadate
      output "input-arpadate = " 
         || input-arpadate
         || "%n"
         || "my-date = " 
         || my-date
         || "%n"
  ; Result of this code:
  ;    input-arpadate = 20 Feb 01 21:38:23
  ;    my-date = 20010220213823+0000