Description

Converts a value from internal storage format to a time output format.

Internal system time is saved as the number of seconds past midnight. A 24-hour day has 86,400 seconds. Any value over that number is divided by 86,400, and the remainder is the value of expression.

Syntax

output = OConv(expression, "MT [H] [S] [char]")

Parameters

OConv (MT) takes the following arguments for its parameters.

ParametersDescription
expressionMust be either an integer or a variable that contains an integer.
MTIndicates a time conversion.
- or - 
MTXMTX is used for international default conversions. Requires that a language is set in the environment, in field 15 (@environ.set<ENV_LND_DEFAULT$> ), eg LND_GERMAN_D, LND_FRENCH_F, etc., etc., etc. The language needs to be set within the SYSENV record prior to start.
HSpecify 12-hour format. The characters used to indicate AM and PM are identified by the default language set.
SIndicates that output includes seconds.
charSpecifies the character that separates hours, minutes, and seconds. The default is a ":" (colon). It can be any character between ASCII characters 33 and 248 inclusive.

See also

Time()IConv Time (MT) function

Example 1

The following table provides examples of the correct use of the OConv Time function.

ExampleOutput
OConv(43260,"MT")12:01
OConv(43260,"MTH")12:01PM
OConv(43260,"MTS")12:01:00
OConv(43260,"MTHS")12:01:00PM
OConv(61200,"MT")17:00
OConv(61200,"MTHS,")05,00,00PM

Example 2

* Converting to time output format.
* The value 08:28PM is saved in TIME.
INTERNAL_TIME = "73680"
Conversion  = "MTH"
TIME = OConv(INTERNAL_TIME, Conversion)
When the language is set to LND_FRENCH_F, the following is observed
* dd will contain 14.48
bb = Oconv(time(), 'MTX')
  • No labels