Product Site

5.4.6.18. init

Initializes a new DateTime instance. If no arguments are specified, the instance is set to the current date and time. If the single fulldate argument is used, the instance is initialized to the date and time calculated by adding fulldate microseconds to 0001-01-01T00:00:00.000000. If the year, month, day, form is used, the instance is initialized to 00:00:00.000000 on the indicated date. Otherwise, the instance is initialized to the year, month, day, hours, minutes, seconds, and microseconds components. Each of these components must be a valid whole number within the acceptable range for the given component. For example, year must be in the range 1-9999, while minutes must be in the range 0-59.

If specified, offset is the offset from UTC, in minutes. The offset must be a valid whole number between -900 and 900 or an equivalent TimeSpan instance. The default offset is the current system timezone offset.
Example 5.230. DateTime class
today = .DateTime~new                            -- current date and time
day = .DateTime~new(date('F', "20170630", "S"))  -- 2017-06-30T00:00:00.000000
day = .DateTime~new(2017, 6, 30)                 -- 2017-06-30T00:00:00.000000
day = .DateTime~new(2017, 6, 30, 11, 8, 50)      -- 2017-06-30T11:08:50.000000