https://github.com/nirdosh17/timeutil
Ruby on Rails inspired time manipulation functions in Go.
https://github.com/nirdosh17/timeutil
date datetime go golang timeutil
Last synced: 7 months ago
JSON representation
Ruby on Rails inspired time manipulation functions in Go.
- Host: GitHub
- URL: https://github.com/nirdosh17/timeutil
- Owner: nirdosh17
- License: mit
- Created: 2022-04-10T17:45:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T13:27:19.000Z (over 2 years ago)
- Last Synced: 2025-05-20T13:55:59.260Z (8 months ago)
- Topics: date, datetime, go, golang, timeutil
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/nirdosh17/timeutil)
# Utility functions for Time
Ruby on Rails inspired utility functions for **Go** to manipulate Time.
## Install
`go get github.com/nirdosh17/timeutil`
## Usage
```go
newT := timeutil.BeginningOfDay(time.Now())
fmt.Println(newT)
```
## Available Functions
- `BeginningOfDay(Time) Time`
- `BeginningOfHour(Time) Time`
- `BeginningOfMinute(Time) Time`
- `EndOfDay(Time) Time`
- `EndOfHour(Time) Time`
- `EndOfMinute(Time) Time`
- `MonthsAgo(Time, days) Time`
- `MonthsAfter(Time, days) Time`
- `DaysAgo(Time, days) Time`
- `DaysAfter(Time, days) Time`
- `IsWeekday(Time) bool`
- `IsWeekend(Time) bool`