{"id":13983593,"url":"https://github.com/itchyny/timefmt-go","last_synced_at":"2025-05-15T20:05:58.657Z","repository":{"id":57534278,"uuid":"282049668","full_name":"itchyny/timefmt-go","owner":"itchyny","description":"Efficient time formatting library (strftime, strptime) for Golang","archived":false,"fork":false,"pushed_at":"2024-08-17T11:26:33.000Z","size":116,"stargazers_count":183,"open_issues_count":0,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T01:39:03.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/itchyny.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-23T20:32:09.000Z","updated_at":"2025-03-22T20:54:30.000Z","dependencies_parsed_at":"2024-04-09T18:55:32.944Z","dependency_job_id":"0307f43a-64a1-49d1-8d6b-7d251315f2aa","html_url":"https://github.com/itchyny/timefmt-go","commit_stats":{"total_commits":138,"total_committers":3,"mean_commits":46.0,"dds":0.1811594202898551,"last_synced_commit":"8eb94fd93fc611d6ff21c384791f07db7fe417b3"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Ftimefmt-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Ftimefmt-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Ftimefmt-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Ftimefmt-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itchyny","download_url":"https://codeload.github.com/itchyny/timefmt-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"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-08-09T05:01:49.280Z","updated_at":"2025-05-15T20:05:53.570Z","avatar_url":"https://github.com/itchyny.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# timefmt-go\n[![CI Status](https://github.com/itchyny/timefmt-go/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/itchyny/timefmt-go/actions?query=branch:main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/itchyny/timefmt-go)](https://goreportcard.com/report/github.com/itchyny/timefmt-go)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/itchyny/timefmt-go/blob/main/LICENSE)\n[![release](https://img.shields.io/github/release/itchyny/timefmt-go/all.svg)](https://github.com/itchyny/timefmt-go/releases)\n[![pkg.go.dev](https://pkg.go.dev/badge/github.com/itchyny/timefmt-go)](https://pkg.go.dev/github.com/itchyny/timefmt-go)\n\n### Efficient time formatting library (strftime, strptime) for Golang\nThis is a Go language package for formatting and parsing date time strings.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/itchyny/timefmt-go\"\n)\n\nfunc main() {\n\tt, err := timefmt.Parse(\"2020/07/24 09:07:29\", \"%Y/%m/%d %H:%M:%S\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(t) // 2020-07-24 09:07:29 +0000 UTC\n\n\tstr := timefmt.Format(t, \"%Y/%m/%d %H:%M:%S\")\n\tfmt.Println(str) // 2020/07/24 09:07:29\n\n\tstr = timefmt.Format(t, \"%a, %d %b %Y %T %z\")\n\tfmt.Println(str) // Fri, 24 Jul 2020 09:07:29 +0000\n}\n```\n\nPlease refer to [`man 3 strftime`](https://linux.die.net/man/3/strftime) and\n[`man 3 strptime`](https://linux.die.net/man/3/strptime) for formatters.\nAs an extension, `%f` directive is supported for zero-padded microseconds, which originates from Python.\nNote that `E` and `O` modifier characters are not supported.\n\n## Comparison to other libraries\n- This library\n  - provides both formatting and parsing functions in pure Go language,\n  - depends only on the Go standard libraries not to grow up dependency.\n- `Format` (`strftime`) implements glibc extensions including\n  - width specifier like `%6Y %10B %4Z` (limited to 1024 bytes),\n  - omitting padding modifier like `%-y-%-m-%-d`,\n  - space padding modifier like `%_y-%_m-%_d`,\n  - upper case modifier like `%^a %^b`,\n  - swapping case modifier like `%#Z`,\n  - time zone offset modifier like `%:z %::z %:::z`,\n  - and its performance is very good.\n- `AppendFormat` is provided for reducing allocations.\n- `Parse` (`strptime`) allows to parse\n  - composed directives like `%F %T`,\n  - century years like `%C %y`,\n  - week directives like `%W %a` and `%G-W%V-%u`.\n- `ParseInLocation` is provided for configuring the default location.\n\n![](https://user-images.githubusercontent.com/375258/88606920-de475c80-d0b8-11ea-8d40-cbfee9e35c2e.jpg)\n\n## Bug Tracker\nReport bug at [Issues・itchyny/timefmt-go - GitHub](https://github.com/itchyny/timefmt-go/issues).\n\n## Author\nitchyny (\u003chttps://github.com/itchyny\u003e)\n\n## License\nThis software is released under the MIT License, see LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Ftimefmt-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitchyny%2Ftimefmt-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Ftimefmt-go/lists"}