Date: Difference between revisions

From DWIKI
mNo edit summary
Line 3: Line 3:
*https://linuxconfig.org/addition-and-subtraction-arithmetics-with-linux-date-command
*https://linuxconfig.org/addition-and-subtraction-arithmetics-with-linux-date-command


=FAQ=


==Convert timestamp to readable==
= FAQ =
 
== Convert timestamp to readable ==
 
  date -d '@1527153367'
  date -d '@1527153367'


 
== Number of days to date ==


==Number of days to date==
  echo \(`date +%s -d 'Jul  3 09:48:30 2020 GMT'`-`date +%s`\)/86400|bc
  echo \(`date +%s -d 'Jul  3 09:48:30 2020 GMT'`-`date +%s`\)/86400|bc
     
== Now ==
date -d now +%s
== String to epoch ==
date -s 'Jul  3 09:48:30' +%s

Revision as of 16:06, 18 January 2022

Links


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

date -d now +%s

String to epoch

date -s 'Jul  3 09:48:30' +%s