datetime-from-parts()
This function creates a timestamp using the values of a to h representing the parts of a date in descending order.
Parameters
Parameter |
Description |
a |
Year. |
b |
Month. |
c |
Day. |
d |
(optional) Hour. |
e |
(optional) Minute. |
f |
(optional) Second. |
g |
(optional) Millisecond. |
h |
(optional) Time zone. Default: The server's time zone. If an invalid time zone name has been specified, GMT is used. The time zone can also be set with an offset in milliseconds, starting from GMT. Example: +3600000 or -3600000. If a valid time zone can be found for this, it is used (here GMT+0100, or GMT-0100), otherwise a generic one is used. Important note : The abbreviated forms should be avoided because some of them have been used for different time zones, making it impossible to ensure the usage of the correct one. Java only supports these forms for backwards compatibility reasons. After an update of the Java Virtual Machine or the operating system, it is possible that a profile returns a different result. Allowed abbreviations: GMT, UTC, SYSTEM (local time zone of server). Allowed abbreviations: GMT, UTC, SYSTEM (local time zone of server). Examples: America/New_York Europe/Berlin |
Examples
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Parameter e |
Parameter f |
Parameter g |
Parameter h |
Result |
2005 |
8 |
15 |
12 |
34 |
56 |
123 |
America/Detroit |
2005-08-15 12:34:56.123 |
2005 |
8 |
15 |
|
|
|
|
Europe/Berlin |
2005-08-15 00:00:00.0 |
2005 |
8 |
15 |
|
|
|
|
|
2005-08-15 00:00:00.0 |
2021 |
03 |
28 |
02 |
30 |
00 |
50 |
Europe/Berlin |
2021-03-28 02:30:00.50 Note: Please note that this is not actually a valid time, as there is a time change to 03:00:00 on this date at 02:00:00. |