Skip to content

Commit

Permalink
time.now() now returns the unix timestamp in seconds rather than nano…
Browse files Browse the repository at this point in the history
…seconds
  • Loading branch information
kaidesu committed Oct 18, 2023
1 parent b3c89cd commit 76a4def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/modules/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func timeNow(scope *object.Scope, tok token.Token, args ...object.Object) object
return nil
}

nano := decimal.NewFromInt(time.Now().UnixNano())
unix := decimal.NewFromInt(time.Now().Unix())

return &object.Number{Value: nano}
return &object.Number{Value: unix}
}

// properties
Expand Down

0 comments on commit 76a4def

Please sign in to comment.