{"id":16296841,"url":"https://github.com/windomz/timezh","last_synced_at":"2025-04-09T13:34:03.410Z","repository":{"id":83794856,"uuid":"132255416","full_name":"WindomZ/timezh","owner":"WindomZ","description":"Golang库 - 时间格式中文化(Chinese style time)","archived":false,"fork":false,"pushed_at":"2018-05-09T16:29:02.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T07:40:42.018Z","etag":null,"topics":["chinese","golang-library","time-format"],"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/WindomZ.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":"2018-05-05T14:30:35.000Z","updated_at":"2021-02-09T12:17:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddd43fb8-f7e3-4962-a1ed-d77dd1044cc8","html_url":"https://github.com/WindomZ/timezh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Ftimezh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Ftimezh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Ftimezh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindomZ%2Ftimezh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WindomZ","download_url":"https://codeload.github.com/WindomZ/timezh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049217,"owners_count":21039177,"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":["chinese","golang-library","time-format"],"created_at":"2024-10-10T20:24:09.518Z","updated_at":"2025-04-09T13:34:03.389Z","avatar_url":"https://github.com/WindomZ.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timezh - Chinese style time\n\n\u003e Golang库 - 时间格式中文化\n\n[![Build Status](https://travis-ci.org/WindomZ/timezh.svg?branch=master)](https://travis-ci.org/WindomZ/timezh)\n[![Coverage Status](https://coveralls.io/repos/github/WindomZ/timezh/badge.svg?branch=master)](https://coveralls.io/github/WindomZ/timezh?branch=master)\n[![GoDoc](https://godoc.org/github.com/WindomZ/timezh?status.svg)](https://godoc.org/github.com/WindomZ/timezh)\n[![Go Report Card](https://goreportcard.com/badge/github.com/WindomZ/timezh)](https://goreportcard.com/report/github.com/WindomZ/timezh)\n\n扩展原生`time`快速实现时间格式中文化\n\n## Install\n```bash\ngo get github.com/WindomZ/timezh\n```\n\n### Roadmap\n- [x] Format\n  - [x] Format(string) string\n  - [x] FormatMix(string) string\n  - [x] FormatLayout(string) string\n  - [x] FormatValue(string) string\n- [x] Parse\n  - [x] Parse(string, string) (Time, error)\n  - [x] ParseLayout(string) string\n  - [x] ParseValue(string) string\n\n## Usage\n|格式用途|原生`time`|引入`timezh`|\n|:-----:|:-----:|:-----:|\n|月份|January, Jan|一月|\n|星期|Monday, Mon|星期一, 周一|\n|上下午|PM, pm|下午|\n\n`time`库**不支持**中文化：\n```go\nimport \"time\"\n\ntime.Now().Format(\"2006年01月02日(January) PM3:04:05 Monday(Mon)\")\n\n\u003e\u003e\u003e 2009年01月03日(January) PM6:15:05 Saturday(Sat)\n```\n\n`timezh`库**支持**中文化：\n```go\nimport \"github.com/WindomZ/timezh\"\n\ntimezh.Now().Format(\"2006年01月02日(一月) 下午3:04:05 星期一(周一)\")\n\n\u003e\u003e\u003e 2009年01月03日(一月) 下午6:15:05 星期六(周六)\n```\n\n`timezh`库**支持**中文解析：\n```go\nimport \"github.com/WindomZ/timezh\"\n\ntimezh.Parse(\"2006年01月02日(一月) 下午3:04:05 星期一(周一)\", \"2009年01月03日(一月) 下午6:15:05 星期六(周六)\")\n\ntime.Now().Format(\"2006年01月02日(January) PM3:04:05 Monday(Mon)\")\ntimezh.Now().Format(\"2006年01月02日(一月) 下午3:04:05 星期一(周一)\")\n\n\u003e\u003e\u003e 2009年01月03日(January) PM6:15:05 Saturday(Sat)\n\u003e\u003e\u003e 2009年01月03日(一月) 下午6:15:05 星期六(周六)\n```\n\n### Advanced\n混杂中英文：\n```go\nimport \"github.com/WindomZ/timezh\"\n\ntimezh.Now().FormatMix(\"2006年01月02日(January, 一月) 下午3:04:05PM 星期一(Mon, 周一)\")\n\n\u003e\u003e\u003e 2009年01月03日(January, 一月) 下午6:15:05PM 星期六(Sat, 周六)\n```\n\n文本中文化：\n```go\nimport \"github.com/WindomZ/timezh\"\n\ntimezh.FormatValue(\"2009年01月03日(January) 6:15:05PM 星期六(Sat)\")\n\n\u003e\u003e\u003e 2009年01月03日(一月) 6:15:05下午 星期六(周六)\n```\n\n文本中文解析：\n```go\nimport \"github.com/WindomZ/timezh\"\n\ntimezh.ParseValue(\"2009年01月03日(一月) 6:15:05下午 星期六(周六)\")\n\n\u003e\u003e\u003e 2009年01月03日(Jan) 6:15:05PM Saturday(Sat)\n```\n\n## Benchmark\n详见[BENCHMARK](BENCHMARK.md)\n\n## Contributing\n欢迎你Fork，提交PR，在[issues page](https://github.com/WindomZ/timezh/issues)汇报Bugs、提出新想法等，\n我很乐意能一起参与。\n\n如果你喜欢这个项目，可以点下 :star: 予以支持，谢谢！\n\n## 许可\n[MIT](https://github.com/WindomZ/timezh/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindomz%2Ftimezh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindomz%2Ftimezh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindomz%2Ftimezh/lists"}