Skip to content

Instantly share code, notes, and snippets.

@awaxa
Last active February 23, 2017 16:28
Show Gist options
  • Save awaxa/f7f4693c9601539c087f93631227ff96 to your computer and use it in GitHub Desktop.
Save awaxa/f7f4693c9601539c087f93631227ff96 to your computer and use it in GitHub Desktop.
#!/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")'
@nicowilliams
Copy link

nicowilliams commented Feb 23, 2017

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.

@nicowilliams
Copy link

@nicowilliams
Copy link

Thanks for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment