{"id":18326501,"url":"https://github.com/ghosind/go-date","last_synced_at":"2025-04-09T16:25:27.070Z","repository":{"id":173680144,"uuid":"651132901","full_name":"ghosind/go-date","owner":"ghosind","description":"The extends of the Golang built-in time package.","archived":false,"fork":false,"pushed_at":"2024-11-21T14:36:39.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T09:46:03.526Z","etag":null,"topics":["date","datetime","datetime-format","go-library","golang","golang-package","time","time-formatting"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/ghosind/go-date","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/ghosind.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-08T15:07:27.000Z","updated_at":"2024-11-21T14:36:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8b5778d-8f30-4d19-930a-fd22025546aa","html_url":"https://github.com/ghosind/go-date","commit_stats":null,"previous_names":["ghosind/go-date"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fgo-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fgo-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fgo-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosind%2Fgo-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghosind","download_url":"https://codeload.github.com/ghosind/go-date/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248066321,"owners_count":21042086,"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":["date","datetime","datetime-format","go-library","golang","golang-package","time","time-formatting"],"created_at":"2024-11-05T19:07:05.320Z","updated_at":"2025-04-09T16:25:27.045Z","avatar_url":"https://github.com/ghosind.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Date\n\n![test](https://github.com/ghosind/go-date/workflows/test/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ghosind/go-date)](https://goreportcard.com/report/github.com/ghosind/go-date)\n[![codecov](https://codecov.io/gh/ghosind/go-date/branch/main/graph/badge.svg)](https://codecov.io/gh/ghosind/go-date)\n![Version Badge](https://img.shields.io/github/v/release/ghosind/go-date)\n![License Badge](https://img.shields.io/github/license/ghosind/go-date)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ghosind/go-date.svg)](https://pkg.go.dev/github.com/ghosind/go-date)\n\nThe extends of the Golang built-in `time` package.\n\n## Installation\n\nRun the following command to install the library, which requires Go 1.20 and later versions.\n\n```sh\ngo get -u github.com/ghosind/go-date\n```\n\n## Getting Started\n\nThis library overwrites the built-in format layouts, the following example is a simple implementation of parsing a string:\n\n```go\nstr := \"2024-01-10 23:59:30\"\nlayout := \"YYYY-MM-DD HH:mm:ss\"\ntm, err := date.Parse(layout, str)\nif err != nil {\n  // handle error\n}\nfmt.Print(tm) // 2024-01-10 23:59:30 +0000 CST\n```\n\nYou can also use the `Format` method to format the `Time` to a string:\n\n```go\ntm := Date(2024, time.January, 1, 23, 59, 30, 0)\nfmt.Print(fm.Format(\"YYYY-MM-DD HH:mm:ss\")) // 2024-01-10 23:59:30\n```\n\n## Available Formats\n\n| Format | Description                                 |       Example        |\n| :----: | :------------------------------------------ | :------------------: |\n| `YYYY` | 4-digits year                               |        `2023`        |\n|  `YY`  | 2-digits year                               |         `23`         |\n|  `MM`  | 2-digits month                              |      `01`-`12`       |\n|  `M`   | Month, beginning at 1                       |       `1`-`12`       |\n| `MMMM` | The month name                              | `January`-`December` |\n| `MMM`  | The abbreviated month name                  |     `Jan`-`Dec`      |\n|  `DD`  | The day of month, 2-digits                  |      `01`-`31`       |\n|  `D`   | The day of month, beginning at 1            |       `1`-`31`       |\n| `dddd` | The day of week                             |  `Sunday`-`Friday`   |\n| `ddd`  | The abbreviated name of weekday             |     `Sun`-`Fri`      |\n|  `d`   | The day of week, beginning at 0 (Sunday)    |       `0`-`6`        |\n|  `HH`  | The hour of 24-hour clock, 2-digits         |      `00`-`23`       |\n|  `H`   | The hour of 24-hour clock, beginning at 1   |       `0`-`23`       |\n|  `hh`  | The hour of 12-hour clock, 2-digits         |      `01`-`12`       |\n|  `h`   | The hour of 12-hour clock, beginning at 1   |       `1`-`12`       |\n|  `mm`  | The minutes, 2-digits                       |      `00`-`59`       |\n|  `m`   | The minutes                                 |       `0`-`59`       |\n|  `ss`  | The seconds, 2-digits                       |      `00`-`59`       |\n|  `s`   | The seconds                                 |       `0`-`59`       |\n| `SSS`  | The milliseconds, 3-digits                  |     `000`-`999`      |\n|  `SS`  | The tens of milliseconds, 2-digits          |      `00`-`99`       |\n|  `S`   | The hundreds of milliseconds, 1-digit       |       `0`-`9`        |\n|  `A`   | Post or ante meridiem, in upper case        |      `AM`, `PM`      |\n|  `a`   | Post or ante meridiem, in lower case        |      `am`, `pm`      |\n|  `Z`   | Timezone offset from UTC, separate by colon |       `-08:00`       |\n|  `ZZ`  | Timezone offset from UTC                    |       `-0800`        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosind%2Fgo-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghosind%2Fgo-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosind%2Fgo-date/lists"}