1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

feat:add AddYear func (#96)

Co-authored-by: leitao <leitao@kezaihui.com>
This commit is contained in:
tlei995
2023-05-18 10:14:23 +08:00
committed by GitHub
parent 82cb86b35c
commit aa8e0d5c12
3 changed files with 34 additions and 0 deletions

View File

@@ -72,6 +72,10 @@ func AddDay(t time.Time, day int64) time.Time {
return t.Add(24 * time.Hour * time.Duration(day))
}
func AddYear(t time.Time, year int64) time.Time {
return t.Add(365 * 24 * time.Hour * time.Duration(year))
}
// GetNowDate return format yyyy-mm-dd of current date.
// Play: https://go.dev/play/p/PvfkPpcpBBf
func GetNowDate() string {