{"id":16881616,"url":"https://github.com/benbjohnson/timeshifter","last_synced_at":"2025-03-20T03:35:01.133Z","repository":{"id":66318104,"uuid":"952157","full_name":"benbjohnson/timeshifter","owner":"benbjohnson","description":"A Ruby library for shifting time.","archived":false,"fork":false,"pushed_at":"2010-09-30T19:59:37.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T23:56:15.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/benbjohnson.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":"2010-09-30T19:28:57.000Z","updated_at":"2013-12-20T15:18:06.000Z","dependencies_parsed_at":"2023-02-20T02:00:33.486Z","dependency_job_id":null,"html_url":"https://github.com/benbjohnson/timeshifter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Ftimeshifter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Ftimeshifter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Ftimeshifter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Ftimeshifter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbjohnson","download_url":"https://codeload.github.com/benbjohnson/timeshifter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244544788,"owners_count":20469729,"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-13T16:04:24.189Z","updated_at":"2025-03-20T03:35:01.113Z","avatar_url":"https://github.com/benbjohnson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Timeshifter\n===========\n\n## DESCRIPTION\n\nTimeshifter is a library for shifting time around within a day. You can set\nvalid hour ranges and Timeshifter will spread a time out within those ranges.\n\nFor example, say your valid ranges are outside business hours (midnight until\n9am and 5pm until midnight). You can set those as your valid ranges and shift\nyour time within those ranges:\n\n\t# Create a shifter for 12am-9am, 5pm-12am\n\tshifter = Timeshifter.new([0..9, 17..24])\n\tshifter.total_hours  # =\u003e 16\n\tshifter.shift(Time.utc(2010, 1, 1, 0, 0, 0))     # =\u003e \"Fri Jan 01 00:00:00 UTC 2010\"\n\tshifter.shift(Time.utc(2010, 1, 1, 12, 0, 0))    # =\u003e \"Fri Jan 01 08:00:00 UTC 2010\"\n\tshifter.shift(Time.utc(2010, 1, 1, 18, 0, 0))    # =\u003e \"Fri Jan 01 20:00:00 UTC 2010\"\n\tshifter.shift(Time.utc(2010, 1, 1, 23, 59, 59))  # =\u003e \"Fri Jan 01 23:59:59 UTC 2010\"\n\nTimeshifter follows the rules of [Semantic Versioning](http://semver.org/) and\nuses [TomDoc](http://tomdoc.org/) for inline documentation.\n\n\n## CONTRIBUTE\n\nHave a great idea for Timeshifter? Awesome. Fork the repository and add a\nfeature or fix a bug. There are a couple things I ask:\n\n1. You must have tests for all code you check in.\n1. Create an appropriately named topic branch that contains your change.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbjohnson%2Ftimeshifter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbjohnson%2Ftimeshifter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbjohnson%2Ftimeshifter/lists"}