On 7/9/24 03:19, Richard Neill wrote:

IP_JSON=$(curl https://whatsmyip.dev/api/ip)
TS=$(echo $IP_JSON | jq '.ts' -r)
TS=$(echo "$TS/1000" | bc)
DATE=$(date --date @$TS)

This is better, as it saves on subprocesses:

IP_JSON=$(curl https://whatsmyip.dev/api/ip)
TS=$(jq -nr "$IP_JSON|.ts")
DATE=$(date -d @$((TS / 1000)))


Anyway, I don't want to waste everyone's time, so if I haven't convinced you, I'll leave it here, and say thank you very much for your consideration.

You're welcome; closing the bug report.




Reply via email to