ODTIM

xcall ODTIM, stringfmt, odate, otime, flags

ODTIM.SBR performs the reverse function of IDTIM.SBR, i.e. it converts an internal format date and/or time to a string format. Its formatting options are much more extensive, however, than the formats allowed by IDTIM

Parameters

stringfmt  (String)  [out]

the formated date/time string is returned here.

odate  (Num)  [in]

should contain the internal (aka "separated" – see IDTIM for details) date to be formatted. 0 is taken to mean the current date.

otime  (Num)  [in]

should contain the internal time to be formatted, with 0 indicating the current time.

flags  (Num)  [in]

must specify a sum of desired formatting options from the following table:

Value

Meaning

&h0000001

Omit date from output (ignore all other date related flags)

&h0000002

Output the day of the week

&h0000004

Use the full name of the day of the week; else use the first three characters

&h0000008

Output the month as a number (1-12) and ignore flag &h0010.

&h0000010

Output the full name of the month; else use the first character abbreviation

&h0000020

Output four digit year; else two digit year

&h0000040

Output the month first, then the day; else the day first, then the month

&h0000080

If &h0100 not specified, use spaces to separate the parts of the date, as in 17 Jul 2013. If &h0100 is also specified (i.e. &h0080 + &h0100) then use separator character defined in the language definition file (LDF).

&h0000100

If &h0080 not specified, use slashes to separate the parts of the date, as in 7/17/03. If &h0080 is also specified, use LDF separator character (see above).

&h0000200

Omit time from output (ignore all other time related flags)

&h0000400

Omit seconds from the time output

&h0000800

Use 12 hour time format with AM/PM; else use 24 hour format

&h0001000

Do not output a separator between the hours and minutes (also see &h0020000)

&h0002000

Use colon as the time separator; else use the character defined in the LDF

&h0004000

Suppress leading zeroes from numeric portion of date.

&h0020000

Do not output a separator between the minutes and the seconds

&h0400000

Do not output date punctuation

&h0800000

Do not output the day

&h1000000

Do not output the month

&h2000000

Do not output the year

Hex-Decimal Values

 

Comments

If flags is set to 0, the output will appear like this: 17-Jul-03 13:15:58. The special flags value –1 overrides the bit settings in the table and outputs a complete time and date string in the format: Monday, July 17, 2013 01:15:58 PM (with appropriate adjustments based on the language definition file).