0.0.3
This commit is contained in:
12
pkg/dt/time.go
Normal file
12
pkg/dt/time.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package dt
|
||||
|
||||
import "time"
|
||||
|
||||
func GetTime(t string) (time.Time, error) {
|
||||
now := time.Now()
|
||||
d, err := time.ParseDuration(t)
|
||||
if err != nil {
|
||||
return now, err
|
||||
}
|
||||
return now.Add(d), nil
|
||||
}
|
||||
Reference in New Issue
Block a user