Skip to content

Commit

Permalink
[xtime] added time consts (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kucherenkovova authored Jun 6, 2024
1 parent b79199f commit 81a8cab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ use (
./xslices
./xslog
./xstrconv
./xtime
)
7 changes: 7 additions & 0 deletions xtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# xtime
Extensions to the standard Go library's `time` package.

### Install
```
go get github.com/kucherenkovova/gopypaste/[email protected]
```
3 changes: 3 additions & 0 deletions xtime/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/kucherenkovova/gopypaste/xtime

go 1.20
16 changes: 16 additions & 0 deletions xtime/time.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package xtime

import (
"time"
)

const (
Nanosecond time.Duration = 1
Microsecond = 1000 * Nanosecond
Millisecond = 1000 * Microsecond
Second = 1000 * Millisecond
Minute = 60 * Second
Hour = 60 * Minute
Day = 24 * Hour
Week = 7 * Day
)

0 comments on commit 81a8cab

Please sign in to comment.