9 ms·
date +'%F %H:%M:%S.%N' -d @1677954553.2134567654 Adjust the format as desired. Or if there is the number of nsecs rather than the fraction: date +'%F %H:%M:%
by donio 4y ago
date +'%F %H:%M:%S.%N' -d @1677954553.2134567654
Adjust the format as desired.
Or if there is the number of nsecs rather than the fraction:
date +'%F %H:%M:%S.%N' -d @$(dc -e '9k 16779545532134567654 10 9^/p')
The dc stuff is RPN, k sets the precision, p is print.
- watersb 4y agoI got in the habit of using %T for Time (of day), as a shorthand for %H:%M:%S, but I can't recall how portable that is. date "+%F %T.%N"