Home Contents | # time:format | Date/Time | Core4 Lua Commands

## SYNOPSIS

str = time:format(fmt)

## DESCRIPTION

Formats the time stored in time 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 time value as a string.

## ERRORS

Raises an error if time is not a time instance.

## EXAMPLE

> >
t = clock.newTime(13, 43, 0) print(t:format("%I:%M:%S %p"))
01:43:00 pm

## SEE ALSO

clock.currentTime, clock.newTime, time(), time:addMSecs, time:addSecs, time:hour, time:isNull, time:isValid, time:millisecondsFromMidnight, time:minute, time:minutesFromMidnight, time:msec, time:msecsTo, time:second, time:secondsFromMidnight, time:secsTo, time:set, tostring(time)