Created
May 1, 2023 03:47
-
-
Save maggiben/ebd82f2999963de5cf85e222e4cc25dc to your computer and use it in GitHub Desktop.
To ISO8601 date string with locale offset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ardiono Date https://adafruit.github.io/RTClib/html/class_date_time.html#a50502a3a29409c6c2507638779df1a9d | |
let now = new Date(); | |
// correct time zone offset for generating iso string | |
now.setMinutes(now.getMinutes() - now.getTimezoneOffset()) | |
console.log(now.toISOString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment