Difference between revisions of "Date"

From wiki
Jump to navigation Jump to search
(Created page with ";TIMESTAMP=`date +%s%N` :Pretty unique timestamp (seconds since 1-1-1970 and current nanosecond) ;TIMESTAMP=`date +%Y%m%d_%H%M` :Common timestamp (Year, month, day, hour, min...")
 
 
Line 4: Line 4:
 
;TIMESTAMP=`date +%Y%m%d_%H%M`
 
;TIMESTAMP=`date +%Y%m%d_%H%M`
 
:Common timestamp (Year, month, day, hour, minute)
 
:Common timestamp (Year, month, day, hour, minute)
 +
 +
;<nowiki>YESTERDAY=`date -d "yesterday 13:00" +%Y%m%d`</nowiki>
 +
:DST safe way to get yesterday, just using yesterday between 23:00 and 01:00 can have unwanted result.

Latest revision as of 10:47, 12 January 2022

TIMESTAMP=`date +%s%N`
Pretty unique timestamp (seconds since 1-1-1970 and current nanosecond)
TIMESTAMP=`date +%Y%m%d_%H%M`
Common timestamp (Year, month, day, hour, minute)
YESTERDAY=`date -d "yesterday 13:00" +%Y%m%d`
DST safe way to get yesterday, just using yesterday between 23:00 and 01:00 can have unwanted result.