Skip to content

Commit dbd977a

Browse files
committed
doc: added leap second behavior to napi_create_date and napi_get_date_value
napi_create_date and napi_get_date_value ignore leap seconds as per ECMAScript spec that follows POSIX spec for time, comments added to the documentation where added fo clarify it. fixes: #29439
1 parent 233cdb6 commit dbd977a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/n-api.md

+6
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,9 @@ napi_status napi_create_date(napi_env env,
17751775

17761776
Returns `napi_ok` if the API succeeded.
17771777

1778+
This API does not observe leap seconds; they are ignored, as
1779+
ECMAScript aligns with POSIX time specification.
1780+
17781781
This API allocates a JavaScript `Date` object.
17791782

17801783
JavaScript `Date` objects are described in
@@ -2434,6 +2437,9 @@ napi_status napi_get_date_value(napi_env env,
24342437
- `[out] result`: Time value as a `double` represented as milliseconds
24352438
since midnight at the beginning of 01 January, 1970 UTC.
24362439

2440+
This API does not observe leap seconds; they are ignored, as
2441+
ECMAScript aligns with POSIX time specification.
2442+
24372443
Returns `napi_ok` if the API succeeded. If a non-date `napi_value` is passed
24382444
in it returns `napi_date_expected`.
24392445

0 commit comments

Comments
 (0)