Created
July 15, 2016 17:19
-
-
Save niun/be6d97ad4b65f163ab0d0e9fb86a73af to your computer and use it in GitHub Desktop.
show time from Internetz in shell, iso-8601
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
curl -G -s --data-urlencode "format=%FT%T%:z" http://www.timeapi.org/cet/now # www.timeapi.org cet is CET/CEST. Don't use cest | |
date --iso-8601='seconds' -d "$(curl -s http://www.timeapi.org/utc/now)" # www.timeapi.org use local timezone settings | |
date -d "$(curl -s http://www.timeapi.org/utc/now)" +"%FT%T (UTC%:z = %Z)" # not quite ISO with timezone illustration | |
date -d "$(curl -s http://www.timeapi.org/utc/now)" +"%A %d.%m.%Y, %T (UTC%:z = %Z)" # non-ISO, easy readable by a german with day of week | |
date --iso-8601='seconds' -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')" # google.com | |
date --iso-8601='seconds' -d "$(cat </dev/tcp/time.nist.gov/13 | cut -d' ' -f2,3) UTC" # NIST | |
date --iso-8601='seconds' -d "$(cat </dev/tcp/de.pool.ntp.org/13)" # ntp pool project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment