Skip to content
Julian Halliwell edited this page Aug 5, 2023 · 1 revision

Allows the date masks used by the current library instance to be set.

setDateFormats( dateFormats )

Required arguments

  • dateFormats struct: including one or more of the following keys: DATE, TIME, TIMESTAMP, DATETIME.

Notes

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.

Example

spreadsheet = New spreadsheet();
USDateFormat = { DATE: "mm/dd/yyyy" };
spreadsheet.setDateFormats( USDateFormat );
Clone this wiki locally