Home Contents | # tostring(date) | Date/Time | Core4 Lua Commands

## SYNOPSIS

str = tostring(date)

## DESCRIPTION

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

## RETURN VALUE

A string formatted as "YYYY-MM-DD". If date is not valid, returns the string "????-??-??".

## ERRORS

Raises an error if date is not a date instance.

## EXAMPLE

> >
d = clock.currentDate() print (d)
2009-08-06

## 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:format, date:isNull, date:isValid, date:month, date:set, date:setDays90, date:weekNumber, date:year