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

clock.currentDate, clock.newDate, date(), date:addDays, date:addMonths, date:addYears, date:day, date:dayOfWeek, date:dayOfYear, date:days90, date:daysInMonth, date:daysInYear, date:daysTo, date:isNull, date:isValid, date:month, date:set, date:setDays90, date:weekNumber, date:year, tostring(date)