Date creation

1 minute to read Download PDF Edit

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 this 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.

These functions takes between one and 6 input parameters. 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 parameter:

dateTime(2007)

returns

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

Two parameters:

dateTime(2007, 1)

returns

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

Three parameters:

dateTime(2007, 1, 1)

returns

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

Four parameters:

dateTime(2007, 1, 1, 1)

returns

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

Five parameters:

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

returns

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

Six parameters:

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

returns

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

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy