U_FMTTIM

Format a time value into an alpha time string

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall U_FMTTIM(type, time, [hour], [minute], [second], [D_LEFT][, separator])

type

The code for the type of time format. (n)

Code

Display

Storage format

1

HH:MM

HHMM

2

HH:MM am/pm

HHMM

3

HH:MM:SS

HHMMSS

4

HH:MM:SS am/pm

HHMMSS

time

Returned with the formatted time. (a)

hour

(optional) The hour of the time or the entire time in storage format. If not passed, the current system time is assumed. (n)

minute

(optional) The minute of the time. (n)

second

(optional) The second of the time. (n)

D_LEFT

(optional) The left-justification flag. (n)

separator

(optional) The separator between parts of the time (for example, a colon between hour, minute, and second). (a)

U_FMTTIM formats separate time values into an alpha time string.

If hour is passed but minute is not passed, second is ignored and hour is assumed to be the entire time in storage format.

The separator for all the format types will be loaded from separator. The default for separator is the value in g_time_sep, which is defined in tkctl.def and initialized by U_START to a colon (:).

The meridian indicators are the text defined in the UI Toolkit message file as facility DTK, mnemonics “AM” and “PM,” respectively. The actual text is “AM” and “PM,” but can be modified.

In the following example, the time (returned in time) is left-justified and formatted as HH:MM AM/PM.

xcall u_fmttim(2, time, hr, mn,, D_LEFT)

In the second example, the time is returned in time, formatted as HH:MM:SS AM/PM. Stor contains the entire time in storage format in the form HHMMSS.

xcall u_fmttim(4, time, stor)