{"id":19041916,"url":"https://github.com/writetome51/get-ymd-hms","last_synced_at":"2026-04-18T07:36:47.150Z","repository":{"id":122062407,"uuid":"189774613","full_name":"writetome51/get-ymd-hms","owner":"writetome51","description":"Functions receive Date and return object with keys 'ymd' (year month day) and 'hms' (hour minute second).","archived":false,"fork":false,"pushed_at":"2021-02-25T22:49:33.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T02:58:00.966Z","etag":null,"topics":["date-format","date-formatting","dates","javascript","times","typescript","utc","ymd-hms"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/writetome51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-06-01T20:24:26.000Z","updated_at":"2021-12-18T02:39:13.000Z","dependencies_parsed_at":"2023-07-25T07:01:54.912Z","dependency_job_id":null,"html_url":"https://github.com/writetome51/get-ymd-hms","commit_stats":null,"previous_names":["writetome51/get-array-year-month-day-hours-minutes-seconds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/get-ymd-hms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-ymd-hms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-ymd-hms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-ymd-hms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-ymd-hms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/get-ymd-hms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-ymd-hms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date-format","date-formatting","dates","javascript","times","typescript","utc","ymd-hms"],"created_at":"2024-11-08T22:33:20.251Z","updated_at":"2026-04-18T07:36:47.129Z","avatar_url":"https://github.com/writetome51.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get_ymd_hms_local(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;date: Date,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;options? = {includeFullYear: false}\u003cbr\u003e): YMD_HMS\n\nReturns `date` as `YMD_HMS` in local time.\n\n# get_ymd_hms_UTC(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;date: Date,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;options? = {includeFullYear: false}\u003cbr\u003e): YMD_HMS\n\nReturns `date` as `YMD_HMS` in UTC (same as GMT) time.\n\nThese types are part of the public API:\n\n# YMD_HMS = {ymd: Y_M_D, hms: H_M_S}\n\n# Y_M_D = {y: string, m: string, d: string}\nEach string has 2 digits, except: `y` will have 4 digits if `options.includeFullYear`  \nis `true`.\n\n# H_M_S = {h: string, m: string, s: string}\nEach string has 2 digits.\n\n\n## Examples\n```ts\nlet date = new Date();\n\nget_ymd_hms_UTC(date, {includeFullYear: true});\n// --\u003e  {ymd: {y: '2021', m: '02', d: '20'},  hms: {h: '20', m: '30', s: '30'}}\n//       (2021, February 20th, 8:30pm and 30 seconds, UTC)\n\nget_ymd_hms_local(date, {includeFullYear: true});\n// --\u003e  {ymd: {y: '2021', m: '02', d: '20'},  hms: {h: '13', m: '30', s: '30'}}\n//       (2021, February 20th, 1:30pm and 30 seconds, 7 hours behind UTC)\n\nget_ymd_hms_local(date);\n// --\u003e  {ymd: {y: '21', m: '02', d: '20'},  hms: {h: '13', m: '30', s: '30'}}\n```\n\n## Installation\n\n`npm i @writetome51/get-ymd-hms`\n\n## Loading\n```ts\nimport { get_ymd_hms_local, get_ymd_hms_UTC } from '@writetome51/get-ymd-hms';\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Fget-ymd-hms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Fget-ymd-hms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Fget-ymd-hms/lists"}