Skip to content

Commit 72e00f8

Browse files
authored
Merge pull request urfave#2127 from nickajacks1/urfavcli-date-off-by-one
fix: off-by-one in timestamp parsing
2 parents ac40eb5 + cf14b66 commit 72e00f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flag_timestamp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (t *timestampValue) Set(value string) error {
8686

8787
defaultTS, _ := time.ParseInLocation(time.TimeOnly, time.TimeOnly, timestamp.Location())
8888

89-
n := time.Now()
89+
n := time.Now().In(timestamp.Location())
9090

9191
// If format is missing date (or year only), set it explicitly to current
9292
if timestamp.Truncate(time.Hour*24).UnixNano() == defaultTS.Truncate(time.Hour*24).UnixNano() {

0 commit comments

Comments
 (0)