You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking for a more generalized function that can accept a date formatted in this way and turn it into the correct epoch time integer. My jq-fu isn't up to the challenge. Was wondering if anyone had ideas. I've read the related links below.
$ echo '{ "lastSeen": "2024-02-19T17:37:01-05:00" }' | jq '.lastSeen + "Z" | fromdate'
jq: error (at <stdin>:1): date "2024-02-19T17:37:01-05:00Z" does not match format "%Y-%m-%dT%H:%M:%SZ"
Version
jq-1.7.1
Problem
I am working with an API that outputs dates in this format:
I'm trying to parse that
lastSeen
string into epoch time, something likeI am looking for a more generalized function that can accept a date formatted in this way and turn it into the correct epoch time integer. My jq-fu isn't up to the challenge. Was wondering if anyone had ideas. I've read the related links below.
Related
The text was updated successfully, but these errors were encountered: