{"id":29857169,"url":"https://github.com/manuelarte/gotimeplus","last_synced_at":"2026-05-12T09:39:02.177Z","repository":{"id":260623636,"uuid":"881867341","full_name":"manuelarte/gotimeplus","owner":"manuelarte","description":"Utility TimePeriod struct for Golang","archived":false,"fork":false,"pushed_at":"2025-07-13T22:24:29.000Z","size":63,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T22:24:49.110Z","etag":null,"topics":["golang","gotime","library","overlap","period","time","utils"],"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/manuelarte.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,"zenodo":null}},"created_at":"2024-11-01T12:08:37.000Z","updated_at":"2025-07-13T22:24:33.000Z","dependencies_parsed_at":"2024-11-01T13:19:19.805Z","dependency_job_id":"2c84102a-d545-4664-9cb5-a89612454683","html_url":"https://github.com/manuelarte/gotimeplus","commit_stats":null,"previous_names":["manuelarte/gotime","manuelarte/gotimeplus"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/manuelarte/gotimeplus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelarte%2Fgotimeplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelarte%2Fgotimeplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelarte%2Fgotimeplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelarte%2Fgotimeplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manuelarte","download_url":"https://codeload.github.com/manuelarte/gotimeplus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelarte%2Fgotimeplus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267786003,"owners_count":24144125,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","gotime","library","overlap","period","time","utils"],"created_at":"2025-07-30T00:38:50.912Z","updated_at":"2026-05-12T09:38:57.147Z","avatar_url":"https://github.com/manuelarte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🕐GoTime Plus(+)\n\n[![Go](https://github.com/manuelarte/gotimeplus/actions/workflows/go.yml/badge.svg)](https://github.com/manuelarte/gotimeplus/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/manuelarte/gotimeplus)](https://goreportcard.com/report/github.com/manuelarte/gotimeplus)\n![coverage](https://raw.githubusercontent.com/manuelarte/gotimeplus/badges/.badges/main/coverage.svg)\n![version](https://img.shields.io/github/v/release/manuelarte/gotimeplus)\n\nGoTime Plus is a Go library that adds some missing functionality to the standard `time.Time` Go package.\n\n- 🕐[GoTime Plus(+)](#gotime-plus)\n  - ⬇️[How to use it](#how-to-use-it)\n  - 🚀[Features](#features)\n    - [LocalDate](#localdate)\n    - [LocalTime](#localtime)\n    - [LocalDateTime](#localdatetime)\n    - [TimePeriod](#timeperiod)\n  - 📂[Examples](#examples)\n\n## ⬇️How to use it\n\n```bash\ngo get github.com/manuelarte/gotimeplus@latest\n```\n\n## 🚀Features\n\nGoTime Plus contains the following features:\n\n### LocalDate\n\nSame concept as java [LocalDate][javaLocalDate], this struct represents a date, often viewed as year-month-day.\nThis struct does not represent a time or time-zone. Instead, it is a description of the date, as used for birthdays.\nIt cannot represent a `time.Time` without additional information such a time-zone.\n\ne.g.:\n\n```go\ngoBirthdate := localdate.New(2009, time.November, 10)\n```\n\n### LocalTime\n\nSame concept as java [LocalTime][javaLocalTime]. This struct represents a time without a time-zone, such as 10:15:30.\nThis struct does not represent a time or time-zone. Instead, it is a description of the local time, as seen on a wall clock.\nIt cannot represent a `time.Time` without additional information such as date and a time-zone.\n\ne.g.:\n\n```go\nlunchTime := localtime.New(12, 0, 0, 0)\n```\n\n### LocalDateTime\n\nSame concept as java [LocalDateTime][javaLocalDateTime]. This struct represents a date-time, such as 2007-12-03T10:15:30.\nThis struct does not represent a time-zone. Instead, it is a description of the date plus a time.\nIt cannot represent a `time.Time` without additional information such as a time-zone.\n\ne.g.:\n\n```go\nnewYear2025 := localdatetime.New(localdate.New(2025, 1, 1), localtime.New(0, 0, 0, 0))\n```\n\n### TimePeriod\n\nCreate a `TimePeriod` instance by specifying a start time and an end time:\n\n\u003e tp, err := timeperiod.New(startTime, endTime)\n\n- `startTime`: The beginning of the time period. Use `time.Time{}` for no lower limit.\n- `endTime`: The end of the time period. Use `time.Time{}` for no upper limit.\n\nReturns:\n\n- `tp`: The resulting `TimePeriod`.\n- `err`: An error if the inputs are invalid.\n\nThe `TimePeriod` is built based on the overlapping period between the two dates.\n\n```bash\nInput Times\ntime1 ____|________...\ntime2 _________|___...\nResulting Time Period\ntp    ____|‾‾‾‾|___...\n```\n\n\u003e [!WARNING]  \n\u003e Passing a zero value for `startTime` or `endTime` indicates an unbounded period on that side.\n\n---\n\nThe struct also provides a function `Overlaps`. This method checks whether two time periods overlap.\nIf so, returns the overlapping period, e.g.:\n\n```bash\nInput Time Periods\ntp1 ____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾...\ntp2 _________|‾‾‾‾‾‾|__...\nResulting Overlap\ntp  ____|‾‾‾‾|_________...\n```\n\n## 📂Examples\n\nRefer to the [examples](./examples) directory for usage examples.\n\n[javaLocalDate]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html\n[javaLocalTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html\n[javaLocalDateTime]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelarte%2Fgotimeplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelarte%2Fgotimeplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelarte%2Fgotimeplus/lists"}