×

Welcome to TagMyCode

Please login or create account to add a snippet.
2
0
 
1
Language: Bash
Posted by: Mattia Lucariello
Added: Jun 5, 2014 9:48 AM
Views: 29
Tags: date bash
what time is now?
what time was one hour ago?
what time was seven days ago?
  1. # what time is now?
  2. date +%Y%m%d%H%M%S
  3.  
  4. # what time was one hour ago?
  5. date +%Y%m%d%H%M%S -d  "1 hour ago"
  6.  
  7. # what time was seven days ago?
  8. date +%Y%m%d%H%M%S -d  "7 days ago"