Home  Contents

tostring(datetime)

Date/Time Core4 Lua Commands

SYNOPSIS

str = tostring(datetime)

DESCRIPTION

A datetime in string context returns the datetime formatted as per ISO 8601 extended format.

RETURN VALUE

A string formatted as "YYYY-MM-DDTHH:MM:SS". If datetime is not valid, returns the string "????-??-??T??:??:??".

ERRORS

Raises an error if datetime is not a datetime instance.

EXAMPLE

>  > 
d = clock.currentDatetime() print (d)
2009-08-06T10:22:42

SEE ALSO