{"id":16292460,"url":"https://github.com/exogen/pacific-time-offset","last_synced_at":"2026-02-07T19:04:23.647Z","repository":{"id":47914545,"uuid":"234644819","full_name":"exogen/pacific-time-offset","owner":"exogen","description":"Minimal detection of U.S. Pacific Time policy (2007 – present)","archived":false,"fork":false,"pushed_at":"2023-01-05T05:16:30.000Z","size":700,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-04T18:43:04.675Z","etag":null,"topics":["datetime","timezones"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/exogen.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}},"created_at":"2020-01-17T22:06:04.000Z","updated_at":"2022-06-17T04:11:34.000Z","dependencies_parsed_at":"2023-02-03T12:31:55.581Z","dependency_job_id":null,"html_url":"https://github.com/exogen/pacific-time-offset","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/exogen/pacific-time-offset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fpacific-time-offset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fpacific-time-offset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fpacific-time-offset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fpacific-time-offset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exogen","download_url":"https://codeload.github.com/exogen/pacific-time-offset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fpacific-time-offset/sbom","scorecard":{"id":388036,"data":{"date":"2025-08-11","repo":{"name":"github.com/exogen/pacific-time-offset","commit":"0d81f755d2952d02cfc1de4bab05c5c065f31b5a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T17:08:32.835Z","repository_id":47914545,"created_at":"2025-08-18T17:08:32.835Z","updated_at":"2025-08-18T17:08:32.835Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29205006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["datetime","timezones"],"created_at":"2024-10-10T20:06:45.077Z","updated_at":"2026-02-07T19:04:23.628Z","avatar_url":"https://github.com/exogen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pacific-time-offset\n\nGet the U.S. Pacific Time offset for the current or given date.\n\n```console\n$ yarn add pacific-time-offset\n$ npm install pacific-time-offset\n```\n\nIt **ONLY** supports:\n\n- Pacific Time.\n- U.S. policy effective 2007 onwards.\n\nThis will not necessarily be correct for dates before 2007 or for territories\nwhere this policy does not apply.\n\n## Usage\n\nThe default export is a function that will return either the Pacific Standard\nTime or Pacific Daylight Time offset (from UTC) in minutes, either -480 or -420,\ndepending on which applies to the given date. **Note that this is the reverse of\nwhat JavaScript’s weird Date `getTimezoneOffset()` method would return, which is\nthe offset _to_ UTC.**\n\nIf an argument is supplied, it must be a Date instance.\n\n```js\nimport pacificTimeOffset from 'pacific-time-offset';\n\n// -480 or -420, depending on current date.\npacificTimeOffset();\npacificTimeOffset(new Date());\n\n// -480\npacificTimeOffset(new Date('2020-01-01T00:00:00.000Z'));\npacificTimeOffset(new Date(2020, 0, 1));\npacificTimeOffset(new Date(1579296618326));\npacificTimeOffset(new Date(2020, 0, 15));\n\n// -420\npacificTimeOffset(new Date('2020-06-01T00:00:00.000Z'));\npacificTimeOffset(new Date(2020, 5, 1));\npacificTimeOffset(new Date(1594848671814));\npacificTimeOffset(new Date(2020, 6, 15));\n```\n\n### Helpers\n\nAvailable on the exported `pacificTimeOffset` function.\n\n#### PST\n\nThe value -480. You could use this for expressions like\n`pacificTimeOffset() === PST`, for example.\n\n#### PDT\n\nThe value -420. You could use this for expressions like\n`pacificTimeOffset() === PDT`, for example.\n\n#### isDaylightTime\n\nIf you just want to know whether the given date is in Pacific Standard Time or\nPacific Daylight Time and don’t care about the exact offset, there is also an\n`isDaylightTime` helper:\n\n```js\nimport { isDaylightTime } from 'pacific-time-offset';\n\n// true\nisDaylightTime(new Date('2020-06-01T00:00:00.000Z'));\n\n// false\nisDaylightTime(new Date('2020-01-01T00:00:00.000Z'));\n```\n\n## Motivation\n\nJavaScript dates are always in the system’s current time zone, so the only\ninformation available is the local time zone offset. It is very difficult to\ndetermine information about other time zones without pulling in a full library\nlike [Moment](https://momentjs.com) or [Luxon](https://moment.github.io/luxon/)\nwhich incorporate the full\n[IANA time zone database](https://www.iana.org/time-zones) (or something like\nit).\n\nIf you only care about U.S. Pacific Time policy and recent dates, this library\nwill be much, much smaller (even if you trim down builds of the above\nlibraries). This matters if you’re shipping the code in question to browsers.\n\n## Why would I use this?\n\nSometimes you have business functions that consider dates in a specific time\nzone, not necessarily the user’s local time zone. For instance, maybe you’re\nrunning an e-commerce site where timed messages, promotions, etc. are all based\non the company’s “official current time” in a specific time zone. If you have\napplications running on user’s devices (like in their web browser), then how do\nyou tell what time it is in that time zone? Well, if that time zone happens to\nbe Pacific Time, you’re in luck – that’s what this does.\n\n## Alternatives\n\nIf you **know** you will only be running on platforms that support\n[Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat),\nhave consistent locale/language support, and have data for the time zone you’re\ninterested in (implementations technically must only support GMT), then you may\nbe able to use that like so:\n\n```js\nconst formatter = new Intl.DateTimeFormat('en-US', {\n  timeZone: 'America/Los_Angeles',\n  timeZoneName: 'short'\n});\nconst isDaylightTime = date =\u003e formatter.format(date).endsWith('PDT');\n```\n\nAgain, support for this is implementation dependent. If you don’t want to worry\nabout the platform’s locale, time zone, and Intl support, use this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexogen%2Fpacific-time-offset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexogen%2Fpacific-time-offset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexogen%2Fpacific-time-offset/lists"}