OConv Time (MT) function

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.

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

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

ParametersDescription
expressionMust be either an integer or a variable that contains an integer.
MT

- or -

MTX
Indicates a time conversion.

MTX 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. 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.

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

Example codeOutput
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
* 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')
  • guides/programming/programmers_reference_manual/oconv_time_mt.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1