arpadate-to-ymdhms

function

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

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

Use arpadate-to-ymdhms to convert 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

The following program takes a date in ARPA/Internet RFC-822 format and returns it in YYYYMMDDhhmmss+ZHZM format.

  include "omdate.xin"
  
  process
     local string converted-date  ; YYYYMMDDhhmmss+ZHZM format date
     local string input-arpadate initial {"20 Feb 01 21:38:23"}
  
     set converted-date to arpadate-to-ymdhms input-arpadate
  
     output "input-arpadate = " || input-arpadate || "%n"
         || "converted-date = " || converted-date
         || "%n"
The result of running this program might be an output such as
  input-arpadate = 20 Feb 01 21:38:23
  converted-date = 20010220213823+0000

Usage Note

To use arpadate-to-ymdhms, you must include the following code near the top of your program:

  include "omdate.xin"