Title: Add `Date::New` for `std::chrono::system_clock::time_point` · Issue #1704 · nodejs/node-addon-api · GitHub
Open Graph Title: Add `Date::New` for `std::chrono::system_clock::time_point` · Issue #1704 · nodejs/node-addon-api
X Title: Add `Date::New` for `std::chrono::system_clock::time_point` · Issue #1704 · nodejs/node-addon-api
Description: It would be nice to be able to create a Date from a std::chrono::system_clock::time_point Here is my (not so great) implementation): Napi::Value timePointToJsDate(Napi::Env env, std::chrono::system_clock::time_point tp) { using namespace...
Open Graph Description: It would be nice to be able to create a Date from a std::chrono::system_clock::time_point Here is my (not so great) implementation): Napi::Value timePointToJsDate(Napi::Env env, std::chrono::system...
X Description: It would be nice to be able to create a Date from a std::chrono::system_clock::time_point Here is my (not so great) implementation): Napi::Value timePointToJsDate(Napi::Env env, std::chrono::system...
Opengraph URL: https://github.com/nodejs/node-addon-api/issues/1704
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `Date::New` for `std::chrono::system_clock::time_point`","articleBody":"It would be nice to be able to create a `Date` from a `std::chrono::system_clock::time_point`\n\nHere is my (not so great) implementation):\n\n```cpp\nNapi::Value timePointToJsDate(Napi::Env env, std::chrono::system_clock::time_point tp)\n{\n using namespace std::chrono;\n auto ms static_cast\u003cdouble\u003e(duration_cast\u003cmilliseconds\u003e(tp.time_since_epoch()).count());\n return Date::New(env, ms);\n}\n```","author":{"url":"https://github.com/cacharle","@type":"Person","name":"cacharle"},"datePublished":"2026-01-30T04:26:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1704/node-addon-api/issues/1704"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b80fc74e-9606-1a1f-1050-4579670c4525 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D08:3337F1:2DB529:40E2CD:6A4E6AF9 |
| html-safe-nonce | 2bf64307cba299013153e8e894dbe6deadb05bb52d48212f518e28ab830e58e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDA4OjMzMzdGMToyREI1Mjk6NDBFMkNEOjZBNEU2QUY5IiwidmlzaXRvcl9pZCI6IjI1MTM0Njg3MTM3MDI2ODEzMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f04ef6ba7d89d46fd2d4b63c019ee1d9dd4d03fe79a0abfd7bb083c4586b5343 |
| hovercard-subject-tag | issue:3873851707 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node-addon-api/1704/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cdb358a5fe56987cae3c81e72d7ffbd1c3d2ee1e4bb5b71a55cad36ed9af16bb/nodejs/node-addon-api/issues/1704 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cdb358a5fe56987cae3c81e72d7ffbd1c3d2ee1e4bb5b71a55cad36ed9af16bb/nodejs/node-addon-api/issues/1704 |
| og:image:alt | It would be nice to be able to create a Date from a std::chrono::system_clock::time_point Here is my (not so great) implementation): Napi::Value timePointToJsDate(Napi::Env env, std::chrono::system... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cacharle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node-addon-api git https://github.com/nodejs/node-addon-api.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 81384578 |
| octolytics-dimension-repository_nwo | nodejs/node-addon-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81384578 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node-addon-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width