format-ymdhms

function

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

Returns: the specified date in the indicated format


Declaration
define string function 
   format-ymdhms           value string date-format
                 with-date value string ymdhms

Argument definitions

date-format
the format in which you want the specified date, given using OmniMark date format modifiers (such as "=Y/=M/=D", etc)
ymdhms
a date in "YYYYMMDDhhmmss+ZHZM" format


Purpose

Use format-ymdhms to take a date/time in YYYYMMDDhhmmss+ZHZM format and convert it to a string, using the format operations of the OmniMark date operator to guide the conversion.

Example

This example program uses format-ymdhms to format a date for output:

  include "omdate.xin"
  
  process
     output format-ymdhms "Now == =W, =xD =n =xY, =h:=m:=s =a.m. =t%n" with-date now-as-ymdhms
Running this example might yield output such as
  Now = Thursday, 31 October 2019, 03:47:35 p.m. -0400

Usage Note

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

  include "omdate.xin"