Date: Difference between revisions
From DWIKI
mNo edit summary |
mNo edit summary |
||
Line 24: | Line 24: | ||
== String to epoch == | == String to epoch == | ||
date -s 'Jul 3 09:48:30' +%s | date -s 'Jul 3 09:48:30' +%s | ||
[[Category:Shell] |
Revision as of 14:39, 25 March 2022
Links
- https://www.cyberciti.biz/tips/linux-unix-get-yesterdays-tomorrows-date.html
- https://linuxconfig.org/addition-and-subtraction-arithmetics-with-linux-date-command
FAQ
Convert timestamp to readable
date -d '@1527153367'
Number of days to date
echo \(`date +%s -d 'Jul 3 09:48:30 2020 GMT'`-`date +%s`\)/86400|bc
Now in epoch
date +%s
String to epoch
date -s 'Jul 3 09:48:30' +%s
[[Category:Shell]