1 2 3 4 5 6 7 8 9 10
#!/bin/sh # date_iso_utc date_now_iso_utc() { TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ" } posix_time_microseconds() { bc -e "($(perl -MTime::HiRes=gettimeofday -MPOSIX=strftime -e '($s,$us) = gettimeofday(); printf "%d.%06d\n", $s, $us') * 1000)" | cut -d '.' -f 1 }