Date: Difference between revisions

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..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category: Linux/Unix]]
;TIMESTAMP=`date +%s%N`
;TIMESTAMP=`date +%s%N`
:Pretty unique timestamp (seconds since 1-1-1970 and current nanosecond)
:Pretty unique timestamp (seconds since 1-1-1970 and current nanosecond)
Line 4: Line 6:
;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.
:Other words can be used too 'Next Month','Next Monday',...

Latest revision as of 16:26, 4 July 2024


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.
Other words can be used too 'Next Month','Next Monday',...