Last active
February 23, 2017 16:28
-
-
Save awaxa/f7f4693c9601539c087f93631227ff96 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# set -v | |
export TZ=America/Los_Angeles | |
node -e 'console.log(JSON.stringify({date: (new Date).getTime()}))' | jq '.date/1000 | strftime("%Y-%m-%d %H:%M:%S %Z")' | |
export TZ=America/New_York | |
node -e 'console.log(JSON.stringify({date: (new Date).getTime()}))' | jq '.date/1000 | strftime("%Y-%m-%d %H:%M:%S %Z")' | |
export TZ=UTC | |
node -e 'console.log(JSON.stringify({date: (new Date).getTime()}))' | jq '.date/1000 | strftime("%Y-%m-%d %H:%M:%S %Z")' |
Can you show the inputs that jq is getting? Make it
node -e 'console.log(JSON.stringify({date: (new Date).getTime()}))' | jq '.date/1000 | (., strftime("%Y-%m-%d %H:%M:%S %Z"))'
EDIT: Never mind, I can reproduce this.
Thanks for the bug report!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For posterity, according to https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/strptime.3.html
I believe this is cause of what I demonstrated above.