robertkrimen / otto

A JavaScript interpreter in Go (golang)
http://godoc.org/github.com/robertkrimen/otto
MIT License
8.11k stars 585 forks source link

fix!: date underflow / overflow and utc #464

Closed stevenh closed 1 year ago

stevenh commented 1 year ago

Use time.UnixMilli instead of UnixNano for time calculations to avoid underflow / overflow issues.

BREAKING CHANGE: Use a GMT fixed time zone for UTC to mimic toUTCString behaviour of Javascript which outputs in GMT not UTC.

Fixes #302