{"id":18587756,"url":"https://github.com/dolegi/ms","last_synced_at":"2026-04-25T12:34:02.429Z","repository":{"id":57552145,"uuid":"174193286","full_name":"dolegi/ms","owner":"dolegi","description":"Converts time strings to and from number of milliseconds","archived":false,"fork":false,"pushed_at":"2019-03-06T21:47:59.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T07:07:53.883Z","etag":null,"topics":["golang","ms","time"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dolegi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-06T17:52:54.000Z","updated_at":"2019-03-23T04:37:42.000Z","dependencies_parsed_at":"2022-09-26T18:50:34.798Z","dependency_job_id":null,"html_url":"https://github.com/dolegi/ms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dolegi/ms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Fms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Fms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Fms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Fms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolegi","download_url":"https://codeload.github.com/dolegi/ms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolegi%2Fms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"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":["golang","ms","time"],"created_at":"2024-11-07T00:43:36.982Z","updated_at":"2026-04-25T12:34:02.410Z","avatar_url":"https://github.com/dolegi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ms\n[![Build Status](https://travis-ci.org/dolegi/ms.svg?branch=master)](https://travis-ci.org/dolegi/ms)\n\nGolang has support for this built in. Check out [ParseDuration](https://golang.org/pkg/time/#ParseDuration)\n\nConverts time strings to and from number of milliseconds\n\nThis is a rewrite of [zeit/ms](https://github.com/zeit/ms) in golang\n\nDocumentation [godoc](https://godoc.org/github.com/dolegi/ms)\n\n## Examples\n\n```go\nms.Parse('2 days')  // 172800000\nms.Parse('1d')      // 86400000\nms.Parse('10h')     // 36000000\nms.Parse('2.5 hrs') // 9000000\nms.Parse('2h')      // 7200000\nms.Parse('1m')      // 60000\nms.Parse('5s')      // 5000\nms.Parse('1y')      // 31557600000\nms.Parse('100')     // 100\nms.Parse('-3 days') // -259200000\nms.Parse('-1h')     // -3600000\nms.Parse('-200')    // -200\n```\n\n### Convert from Milliseconds\n\n```go\nms.Fmt(60000)             // \"1m\"\nms.Fmt(2 * 60000)         // \"2m\"\nms.Fmt(-3 * 60000)        // \"-3m\"\nms.Fmt(ms('10 hours'))    // \"10h\"\n```\n\n### Time Format Written-Out\n\n```go\nms.FmtLong(60000)                 // \"1 minute\"\nms.FmtLong(2 * 60000)             // \"2 minutes\"\nms.FmtLong(-3 * 60000)            // \"-3 minutes\"\nms.FmtLong(ms.Parse('10 hours'))  // \"10 hours\"\n```\n\n## Tests\nTests can be run with `go test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolegi%2Fms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolegi%2Fms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolegi%2Fms/lists"}