A short post to advise you that you can download for free the “GNU/Linux Advanced Administration” book in PDF forrmat this page, or from this site.
Should be back soon, we will demonstrate how to build a Linux Cluster (Red Hat) in a serie of articles.
See you soon !
You’re doing a script and you need to know what was the date 35 days ago or what will the date be in 21 days. This is where the “date” command can help you doing that kind of calculation. In this little article we will present some examples to help us making some data calculation. I would like to point out, that all of these date calculation take in consideration the leap year.
DISPLAY CURRENT DATE
# date
Sun Jan 17 11:52:40 EST 2010
DISPLAY DATE OF 35 DAYS AGO
# date --date="35 days ago"
Sun Dec 13 11:53:51 EST 2009
DISPLAY DATE OF 2 MONTHS AGO
# date --date="2 months ago"
Tue Nov 17 11:53:53 EST 2009
DISPLAY DATE OF 1 YEAR AGO
# date --date="1 year ago"
Sat Jan 17 11:53:56 EST 2009
DISPLAY DATE 1 HOUR AGO
# date --date="1 hour ago"
Sun Jan 17 10:55:00 EST 2010
DISPLAY DATE THAT WILL BE IN 35 DAYS
# date --date="35 days"
Sun Feb 21 11:56:26 EST 2010
DISPLAY DATE THAT WILL BE IN 1 MONTH
# date --date="1 month"
Wed Feb 17 11:56:32 EST 2010
DISPLAY DATE THAT WILL BE NEXT FRIDAY
# date --date="this friday"
Fri Jan 22 00:00:00 EST 2010
DISPLAY NEXT DAY DATE
# date --date="next day"
Mon Jan 18 11:57:18 EST 2010
CONVERT DATE TO EPOCH TIME
# date -d "20100118" +%s
1263790800
CONVERT EPOCH TIME TO DATE
# date -d @1263790800 "+%Y-%m-%d %T"
2010-01-18 00:00:00
Welcome to LINternUX
This will be day that I posted my first blog.
Live long and prosper.
Recent Comments