Built-In Namespace Date
Method Attributes | Method Name and Description |
---|---|
format(format)
Formats a date according to a few custom options, or the same rules used by Java's SimpleDateFormat class.
|
Method Detail
{String}
format(format)
Formats a date according to a few custom options, or the same rules used by Java's SimpleDateFormat class.
<? var d = new Date(); print(d.format("yyyy-MM-dd'T'h:m:ssZ")); // print date in ISO 8601 format ?>
- Parameters:
- {String} format Optional
- A date format pattern string, or the word "pretty". Defaults to "pretty". Pretty printing will output time-relative dates, such as "5 minutes ago", or "1 year from now". Other formats will be interpreted via the Java SimpleDateFormat rules -- e.g. yyyy-MM-dd HH:mm:ss will output a database suitable format.
- Returns:
- The formatted date/time string