{"id":13482821,"url":"https://github.com/SuperPaintman/ms","last_synced_at":"2025-03-27T13:32:47.185Z","repository":{"id":79226656,"uuid":"73527140","full_name":"SuperPaintman/ms","owner":"SuperPaintman","description":"Library to easily convert various time formats to milliseconds and milliseconds to human readable format.","archived":false,"fork":false,"pushed_at":"2016-11-14T05:17:19.000Z","size":34,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T22:11:40.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://superpaintman.github.io/ms/","language":"Crystal","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/SuperPaintman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-12T02:40:44.000Z","updated_at":"2019-06-20T04:47:36.000Z","dependencies_parsed_at":"2023-06-01T17:31:08.993Z","dependency_job_id":null,"html_url":"https://github.com/SuperPaintman/ms","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperPaintman","download_url":"https://codeload.github.com/SuperPaintman/ms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245854684,"owners_count":20683397,"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-07-31T17:01:05.820Z","updated_at":"2025-03-27T13:32:46.784Z","avatar_url":"https://github.com/SuperPaintman.png","language":"Crystal","funding_links":[],"categories":["Programming Languages","Converters"],"sub_categories":["[Crystal](https://github.com/veelenga/awesome-crystal)"],"readme":"# ms\n\n[![Linux Build][travis-image]][travis-url]\n[![Shards version][shards-image]][shards-url]\n\n\nLibrary to easily convert various time formats to milliseconds and\nmilliseconds to human readable format.\n\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  ms:\n    github: SuperPaintman/ms\n```\n\n\n--------------------------------------------------------------------------------\n\n## Usage\n\n```crystal\nrequire \"ms\"\n\n# == Strings to numbers ===\nms_in_5h = MS.ms(\"5h\")\n# =\u003e 18000000\n\nms_in_20sec = MS.ms(\"20 sec\")\n# =\u003e 20000\n\nms_in_an_hour_and_a_half = MS.ms(\"1.5 hours\")\n# =\u003e 5400000\n\nms_in_day = MS.ms(\"day\")\n# =\u003e 86400000\n\nms_in_2_years = MS.ms(\"2y\")\n# =\u003e 63115200000\n\n\n# === Numbers to strings ===\ntwo_ms = MS.ms(200)\n# =\u003e \"200ms\"\n\nfive_sec = MS.ms(5000)\n# =\u003e \"5s\"\n\nsix_hours = MS.ms(60 * 60 * 1000 * 6)\n# =\u003e \"6h\"\n\n\n# === Numbers to long strings ===\ntwo_long_ms = MS.ms(200, long: true)\n# =\u003e \"200 ms\"\n\nfive_long_sec = MS.ms(1000, long: true)\n# =\u003e \"1 second\"\n\nsix_long_hours = MS.ms(60 * 60 * 1000 * 6, long: true)\n# =\u003e \"6 hours\"\n```\n\n\nor with including:\n\n```crystal\nrequire \"ms\"\ninclude MS\n\nms_in_5h = ms(\"5h\")\n# =\u003e 18000000\n\n# ...\n```\n\n\n--------------------------------------------------------------------------------\n\n## Test\n\n```sh\ncrystal spec\n```\n\n\n--------------------------------------------------------------------------------\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/SuperPaintman/ms/fork\u003e)\n2. Create your feature branch (`git checkout -b feature/\u003cfeature_name\u003e`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin feature/\u003cfeature_name\u003e`)\n5. Create a new Pull Request\n\n\n--------------------------------------------------------------------------------\n\n## Contributors\n\n- [SuperPaintman](https://github.com/SuperPaintman) SuperPaintman - creator, maintainer\n\n\n--------------------------------------------------------------------------------\n\n## API\n[Docs][docs-url]\n\n\n--------------------------------------------------------------------------------\n\n## Changelog\n[Changelog][changelog-url]\n\n\n--------------------------------------------------------------------------------\n\n## License\n\n[MIT][license-url]\n\n\n[license-url]: LICENSE\n[changelog-url]: CHANGELOG.md\n[docs-url]: https://superpaintman.github.io/ms/\n[travis-image]: https://img.shields.io/travis/SuperPaintman/ms/master.svg?label=linux\n[travis-url]: https://travis-ci.org/SuperPaintman/ms\n[shards-image]: https://img.shields.io/github/tag/superpaintman/ms.svg?label=shards\n[shards-url]: https://github.com/superpaintman/ms\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperPaintman%2Fms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSuperPaintman%2Fms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperPaintman%2Fms/lists"}