date: View & Set the UNIX, Linux System Date & Time

Display the system date and time.

# date
Wed Jan 12 20:29:32 GMT 2011

Set the system date and time.

# date --set="13 Jan 2011 21:29:32"

• Get the day of a date

# date -d "April 3, 2011"
Sun Apr  3 00:00:00 BST 2011

• Get relatives date

# date -d '5 months'
Tue Oct 25 20:39:27 BST 2011
# date -d '-5 months'
Sat Dec 25 20:40:07 GMT 2010
# date -d '50 days ago'
Tue Apr  5 20:41:49 BST 2011
# date -d 'next friday'
Fri May 27 00:00:00 BST 2011
# date -d 'April 3, 2011 -3 weeks'
Sun Mar 13 00:00:00 GMT 2011

You May Also Like

Leave a Reply?