date
(GNU date - sigh...)
Normal date command is useless:
:~$date
Tue Jun 4 09:08:04 CEST 2024
How can you even work with this ¯\_(ツ)_/¯
date -I (ISO8601 or nothing) gives:
:~$date -I
2024-06-04
Gives a pretty date, but no time.
:~$ date +'%FT%T' gives pretty date & time:
:~$ date +'%FT%T'
2024-06-04T12:05:24
'T' can be replaces with (more or less) anything, it is just acting as a separator.
date manipulate:
Læs, forstå og skriv noget "nemt":
cyberciti date
Really!??!
:~$ date +%Y:%m:%d -d "1 day ago"
2024:06:03
:~$ date -I -d "1 day ago"
2024-06-03
:~$ date -I -d "2 day ago"
2024-06-02
:~$ date -I -d "1 month ago"
2024-05-04
:~$ date -I -d "1 year ago"
2023-06-04
:~$ date -I -d "-1 year ago"
2025-06-04
:~$ date -I -d "2 day"
2024-06-06
:~$ date -I -d "-2 day"
2024-06-02