{"id":18737897,"url":"https://github.com/technodelight/seconds-to-none","last_synced_at":"2025-11-17T20:30:18.050Z","repository":{"id":57066151,"uuid":"53084985","full_name":"technodelight/seconds-to-none","owner":"technodelight","description":"Seconds to human / human to seconds","archived":false,"fork":false,"pushed_at":"2022-11-21T15:47:42.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T02:17:46.010Z","etag":null,"topics":["human-computer-interaction","php","timestamp"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/technodelight.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":"2016-03-03T21:21:56.000Z","updated_at":"2022-11-15T12:23:18.000Z","dependencies_parsed_at":"2023-01-22T01:47:05.584Z","dependency_job_id":null,"html_url":"https://github.com/technodelight/seconds-to-none","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technodelight%2Fseconds-to-none","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technodelight%2Fseconds-to-none/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technodelight%2Fseconds-to-none/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technodelight%2Fseconds-to-none/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technodelight","download_url":"https://codeload.github.com/technodelight/seconds-to-none/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239611969,"owners_count":19668276,"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":["human-computer-interaction","php","timestamp"],"created_at":"2024-11-07T15:27:22.036Z","updated_at":"2025-11-17T20:30:18.012Z","avatar_url":"https://github.com/technodelight.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seconds-to-none\nSeconds to human / human to seconds\n\nThis is a very minimal library to allow conversion between human time duration representation and time in seconds.\nUsage:\n\n```\n$converter = new \\Technodelight\\SecondsToNone;\n$textRepresentation = $converter-\u003esecondsToHuman(12345);\n// =\u003e '3 hours 25 minutes 45 seconds'\n$seconds = $converter-\u003ehumanToSeconds('3 hours 25 minutes 45 seconds');\n// =\u003e 12345\n```\n\nIf you want, you can configure how the representations are looking like.\n```\n$config = new Technodelight\\SecondsToNone\\Config(['h' =\u003e 3600, 'm' =\u003e 60, 's' =\u003e 1, 'none' =\u003e 0]);\n// above secondsToHuman output with the following config:\n// 3 h 25 m 45 s\n```\nOr the above with a more precise look:\n```\n$config = new Technodelight\\SecondsToNone\\Config(['h' =\u003e 3600, 'm' =\u003e 60, 's' =\u003e 1, 'none' =\u003e 0], '%d%s');\n// above secondsToHuman output with the following config:\n// 3h 25m 45s\n```\nYou can even swap the order by using a custom pattern:\n```\n$config = new Technodelight\\SecondsToNone\\Config(['h' =\u003e 3600, 'm' =\u003e 60, 's' =\u003e 1, 'none' =\u003e 0], '%2$ss%1$d');\n// above secondsToHuman output with the following config:\n// h3 m25 s45\n```\n\nThis micro-library also comes with tests!\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Zsolt Gál\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnodelight%2Fseconds-to-none","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnodelight%2Fseconds-to-none","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnodelight%2Fseconds-to-none/lists"}