NLSFormatDate
NLS Function: Returns a correctly formatted
string containing the date for the current locale.
Module: USE DFNLS
Syntax
- result = NLSFormatDate (outstr
[, intime ] [, flags ])
- outstr
(Output) Character*(*). String containing the correctly formatted
date for the current locale. If outstr is longer than the formatted
date, it is blank-padded.
- intime
(Optional; input) INTEGER(4). If specified, date to be formatted
for the current locale. Must be an integer date such as the packed time
created with PACKTIMEQQ. If you omit intime, the current
system date is formatted and returned in outstr.
- flags
(Optional; input) INTEGER(4). If specified, modifies the date conversion.
If you omit flags, the flag NLS$Normal is used. Available
values (defined in DFNLS.F90 in /DF/INCLUDE) are:
- NLS$Normal - No special formatting
- NLS$NoUserOverride - Do not use user overrides
- NLS$UseAltCalendar - Use the locale's alternate
calendar
- NLS$LongDate - Use local long date format
- NLS$ShortDate - Use local short date format
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:
- NLS$ErrorInsufficentBuffer - outstr
buffer is too small
- NLS$ErrorInvalidFlags - flags has
an illegal value
- NLS$ErrorInvalidInput - intime has
an illegal value
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL
LIB
See Also: NLSFormatTime,
NLSFormatCurrency,
NLSFormatNumber
Examples
USE DFNLS
INTEGER(4) i
CHARACTER(40) str
i = NLSFORMATDATE(str, NLS$NORMAL) ! 8/1/94
i = NLSFORMATDATE(str, NLS$USEALTCALENDAR) ! 8/1/94
i = NLSFORMATDATE(str, NLS$LONGDATE) ! Monday, August 1, 1994
i = NLSFORMATDATE(str, NLS$SHORTDATE) ! 8/1/94
END