{"id":17148106,"url":"https://github.com/evantahler/system-timezone","last_synced_at":"2025-04-13T11:41:04.383Z","repository":{"id":65374310,"uuid":"42780612","full_name":"evantahler/system-timezone","owner":"evantahler","description":"A node.js package to return this host's timezone","archived":false,"fork":false,"pushed_at":"2018-03-19T10:40:30.000Z","size":136,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T02:43:49.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evantahler.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-19T16:34:37.000Z","updated_at":"2017-05-11T10:57:28.000Z","dependencies_parsed_at":"2023-01-20T01:15:42.491Z","dependency_job_id":null,"html_url":"https://github.com/evantahler/system-timezone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evantahler%2Fsystem-timezone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evantahler%2Fsystem-timezone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evantahler%2Fsystem-timezone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evantahler%2Fsystem-timezone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evantahler","download_url":"https://codeload.github.com/evantahler/system-timezone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248709400,"owners_count":21149178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-14T21:27:13.076Z","updated_at":"2025-04-13T11:41:04.361Z","avatar_url":"https://github.com/evantahler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System Timezone\n[![Build Status](https://travis-ci.org/evantahler/system-timezone.svg)](https://travis-ci.org/evantahler/system-timezone)\n\nA simple package that checks various system configuration files in an attempt to determine what *this* computer's timezone is (in Olson notation).  \n\nThis is a 100% javasctipt package that should work on any version of `node \u003e 0.10.0`.\n\nWe do this via 4 methods:\n\n1. If `process.env.TZ` is set, return it\n2. If `/etc/timezone` is present, return the contents of the file\n3. If `/etc/localtime` is present, and is a symlink to a file in `/usr/share/zoneinfo`, we can follow the link to know the proper timezone\n4. If `/etc/localtime` is present, but not a symlink, we MD5 the contents and compare it to all other files in, `/usr/share/zoneinfo`, and then return the name of the first match.\n\n## Examples:\n\n```javascript\nvar system_timezone = require('system-timezone');\n\n// This is a slow, sync call.  It would be best to call it once at boot and cache the response\n// If a timezone cannot be determined, an Error will be thrown.\nvar thisTimezone = system_timezone();\n\nconsole.log( thisTimezone ); // America/Los_Angeles\n```\n\n## TODO:\n- can we test this without messing up system time?\n- can we get this to work on windows?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevantahler%2Fsystem-timezone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevantahler%2Fsystem-timezone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevantahler%2Fsystem-timezone/lists"}