NLSFormatTime

NLS Function: Returns a correctly formatted string containing the time for the current locale.

Module: USE DFNLS

Syntax

result = NLSFormatTime (outstr [, intime ] [, flags ])

outstr
(Output) Character*(*). String containing the correctly formatted time for the current locale. If outstr is longer than the formatted time, it is blank-padded.


intime
(Optional; input) INTEGER(4). If specified, time to be formatted for the current locale. Must be an integer time such as the packed time created with PACKTIMEQQ. If you omit intime, the current system time is formatted and returned in outstr.


flags
(Optional; input) INTEGER(4). If specified, modifies the time conversion. If you omit flags, the flag NLS$Normal is used. Available values (defined in DFNLS.F90 in /DF/INCLUDE) are:


Results:

The result is of type INTEGER(4). The result is the number of characters written to outstr (bytes are counted, not multibyte characters). If an error occurs, the result is one of the following negative values:

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: NLSFormatCurrency, NLSFormatDate, NLSFormatNumber

Examples

 USE DFNLS
 INTEGER(4) i
 CHARACTER(20) str
 i = NLSFORMATTIME(str, NLS$NORMAL)              ! 11:38:28 PM
 i = NLSFORMATTIME(str, NLS$NOMINUTESORSECONDS)  ! 11 PM
 i = NLSFORMATTIME(str, NLS$NOTIMEMARKER)        ! 11:38:28 PM
 i = NLSFORMATTIME(str, IOR(NLS$FORCE24HOURFORMAT,               &
 &                      NLS$NOSECONDS))          ! 23:38 PM
 END