Time - script and chart function
Time() formats an expression as a time value, in the time format set in the system variables in the data load script, or in the operating system, unless a format string is supplied.
Syntax:
Time(number[, format])
Return data type: dual
Argument | Description |
---|---|
number | The number to be formatted. |
format |
String describing how the resulting time string is to be formatted. If omitted, the time format and decimal separator set in the operating system is used. The Time function supports many format options for different time structures, for example: hh:mm:ss—Formats a time value in a standard time format and display hours, minutes, and seconds with leading zeros. hh:mm TT—Uses a 12-hour format with AM/PM suffix. hh:mm—Shows only hours and minutes, omitting seconds. hh.mm.ss—Time format with different separators, such as a period (.) instead of a colon. hh TT—Includes only hour and AM/PM. hh "Hrs" mm "Mins"—Displays the time with custom text, such as Hrs. |
Example | Result |
---|---|
Time( 0.375 ) | Returns 09:00:00 when the TimeFormat setting is 'hh:mm:ss'. |
Time( 35648.375 ) | Returns 09:00:00 when the Timeformat supplied is 'hh:mm:ss'. |
Time( 0.99999, 'hh-mm' ) | Returns 23-59 by ignoring the TimeFormat setting since the format is supplied in the measure. |