-
-
Couldn't load subscription status.
- Fork 39
setDateFormats
Julian Halliwell edited this page May 21, 2025
·
6 revisions
Allows the date masks used by the current library instance to be set.
setDateFormats( dateFormats )
-
dateFormatsstruct: including one or more of the following keys:DATE,TIME,TIMESTAMP,DATETIME.
The following international date masks are used by default to read and write cell values formatted as dates:
- DATE =
yyyy-mm-dd - TIME =
hh:mm:ss - TIMESTAMP =
yyyy-mm-dd hh:mm:ss
An additional mask is used to output datetime values from the read() method into HTML or CSV formats:
- DATETIME =
yyyy-mm-dd HH:nn:ss
NB: Do not confuse DATETIME and TIMESTAMP. In general you should override the TIMESTAMP mask.
You can override the defaults by
- passing in a struct including the value(s) to be overridden when instantiating the Spreadsheet component OR
- using the
setDateFormats()method on an existing instance
USDateFormat = { DATE: "mm/dd/yyyy" }
spreadsheet = New spreadsheetCFML.Spreadsheet( dateFormats=USDateFormat )
USDateFormat = { DATE: "mm/dd/yyyy" }
spreadsheet = New spreadsheetCFML.Spreadsheet()
spreadsheet.setDateFormats( USDateFormat )
USDateFormat = { DATE: "mm/dd/yyyy" }
spreadsheet = New spreadsheetCFML.Spreadsheet().setDateFormats( USDateFormat )