{"id":21744285,"url":"https://github.com/oeo/timebase","last_synced_at":"2026-01-28T12:01:40.299Z","repository":{"id":259458237,"uuid":"877578832","full_name":"oeo/timebase","owner":"oeo","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T01:21:41.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T16:55:00.352Z","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/oeo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T22:34:59.000Z","updated_at":"2024-10-24T01:21:45.000Z","dependencies_parsed_at":"2025-02-12T18:15:15.356Z","dependency_job_id":null,"html_url":"https://github.com/oeo/timebase","commit_stats":null,"previous_names":["oeo/timebase"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oeo/timebase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oeo%2Ftimebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oeo%2Ftimebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oeo%2Ftimebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oeo%2Ftimebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oeo","download_url":"https://codeload.github.com/oeo/timebase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oeo%2Ftimebase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2024-11-26T07:11:01.515Z","updated_at":"2026-01-28T12:01:40.260Z","avatar_url":"https://github.com/oeo.png","language":"JavaScript","readme":"![Run Tests](../../actions/workflows/test.yml/badge.svg)\n\n# timebase\n\nget the start of a time period. uses just a singular runtime dependency, [moment-timezone](https://www.npmjs.com/package/moment-timezone).\n\n## install\n\n```bash\nnpm install timebase --save\n```\n\n## use\n\n```javascript\nconst timebase = require('timebase');\ntimebase.DEFAULT_TIMEZONE = 'UTC';\n\n// return the 00:00:00 unix timestamp of the current day\nconsole.log(timebase());\n\n// return the 00:00:00 unix timestamp of yesterday\nlet yesterday = timebase(timebase() - 1);\nconsole.log(timebase(yesterday));\n\n// give me the start of the day as a timestamp for the given unix timestamp\nconsole.log(timebase(1684108800, {startPoint: 'day', timezone: 'America/New_York'}));\n\n// start of current hour for now\nconsole.log(timebase({startPoint: 'hour'}));\n\n// start of month for now\nconsole.log(timebase({startPoint: 'month'}));\n\n// start of year as a date object\nconsole.log(timebase({startPoint: 'year', format: 'date'}));\n\n// start of the day for this date\nconsole.log(timebase('2023-05-15T14:30:00Z'));\n\n// start of minute for now\nconsole.log(timebase({startPoint: 'minute'}));\n```\n\n## options\n\n- startPoint: 'minute', 'hour', 'day', 'month', 'year' (default: 'day')\n- format: 'unixSeconds', 'unixMilliseconds', 'date' (default: 'unixSeconds')\n- timezone: 'America/New_York', 'UTC', etc (default: timebase.DEFAULT_TIMEZONE)\n\n## license\n\nmit\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foeo%2Ftimebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foeo%2Ftimebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foeo%2Ftimebase/lists"}