Home  Contents

date:format

Date/Time Core4 Lua Commands

SYNOPSIS

str = date:format(fmt)

DESCRIPTION

Formats the date stored in date according to the format specification in fmt. This function makes use of the C-library function strftime() and uses the same format specification.

Please see datetime:format() for an explanation of the format string.

RETURN VALUE

The formatted date value as a string.

ERRORS

Raises an error if date is not a date instance.

EXAMPLE

>  > 
t = clock.newDate(1990, 12, 25) print(t:format("%a, %d %b %Y"))
Sun, 25 Dec 1990

SEE ALSO