Date
Format
-
%N
nanoseconds (000000000..999999999) -
%s
seconds since 1970-01-01 00:00:00 UTC
Current time
will return the number of seconds since the epoch.
returns the seconds and current nanoseconds.
will give you the number of milliseconds since the epoch - current seconds plus the left three of the nanoseconds.
Print milliseconds
현재시간을 밀리초 단위로 출력하는 방법은 아래와 같다.
몇 일 전 계산 방법
-d
옵션 사용.
Answer:SteelScrap#cron 을 위한 자동 압축 bash script 에서 사용했다.