Date Creation

Last update: Edit

1 Introduction

Dates can be created with the dateTime and dateTimeUTC functions. The difference between the two is that dateTime uses the calendar of the session used in the function call, and dateTimeUTC uses the UTC calendar. The system session runs as UTC by default, but this can be configured in the project settings.

This function does not accept parameters, only fixed values. To create a date using parameters, use the parseDateTime function.

2 Values

These functions takes between one and six input values. These represent, in order:

  1. years (type: integer, four digits and greater than 1799)
  2. months (type: integer, between 1 and 12)
  3. days (type: integer, between 1 and 31)
  4. hours (type: integer, between 0 and 23)
  5. minutes (type: integer, between 0 and 59)
  6. seconds (type: integer, between 0 and 59)

One value:

dateTime(2007)

returns:

"Mon Jan 01 00:00:00 CET 2007"

Two values:

dateTime(2007, 1)

return:

"Mon Jan 01 00:00:00 CET 2007"

Three values:

dateTime(2007, 1, 1)

return:

"Mon Jan 01 00:00:00 CET 2007"

Four values:

dateTime(2007, 1, 1, 1)

return:

"Mon Jan 01 01:00:00 CET 2007"

Five values:

dateTime(2007, 1, 1, 1, 1)

return:

"Mon Jan 01 01:01:00 CET 2007"

Six values:

dateTime(2007, 1, 1, 1, 1, 1)

return:

"Mon Jan 01 01:01:01 CET 2007"