feat:add AddYear func (#96)

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

No files matched your search

+4
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 {