Skip to content

Commit 55631f4

Browse files
levhitaBridgeAR
authored andcommitted
doc: add leap second behavior notes for napi methods
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. PR-URL: #29569 Fixes: #29439 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 7fd3261 commit 55631f4

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
@@ -1774,6 +1774,9 @@ napi_status napi_create_date(napi_env env,
17741774

17751775
Returns `napi_ok` if the API succeeded.
17761776

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

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

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

0 commit comments

Comments
 (0)