name: duk_components_to_time proto: | duk_double_t duk_components_to_time(duk_context *ctx, duk_time_components *comp); summary: |
Convert components (year, month, day, etc), interpreted in UTC, into a
time value. The comp->weekday
argument is ignored in the
conversion. If the component values are invalid, an error is thrown.
There are some differences to the ECMAScript Date.UTC()
built-in:
Date.UTC(99, 0, 1)
gets interpreted as 1999-01-01.
If comp->time
is 99, it's interpreted as the year 99.Like the ECMAScript primitives, the components can exceed their natural
range and are normalized. For example, specifying comp->minutes
as 120 is interpreted as adding 2 hours to the time value. The components are
expressed as IEEE doubles to allow large and negative values to be used.