Computing.Net > Forums > Unix > Working with dates

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Working with dates

Reply to Message Icon

Name: nauj
Date: December 1, 2005 at 05:13:12 Pacific
OS: AIX
CPU/Ram: AIX
Comment:


I want to add a number to a date and resolve the new date.
For example:
I know the date of today and I want to know the date before a week (7 days)
date2 = date + 7
Using formats echo the new date
echo `date2 '+%Y%m%d'`
¿is that possible?
¿is there any function to add days to a date this?
Any advice will be greatly apprecited



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: December 1, 2005 at 07:06:44 Pacific
Reply:

Take a look at Mr. WilliamRobertson's shift_date script:

http://www.unixreview.com/documents/s=9020/ur0401d/ur0401d.htm


0

Response Number 2
Name: aarora_98
Date: December 5, 2005 at 05:06:26 Pacific
Reply:

I want make a directory with current system date.... Can anybody help me for what should I use in mkdir cmd so that it will automatically name my directory as current sys date ?.


0

Response Number 3
Name: WilliamRobertson
Date: December 5, 2005 at 11:13:17 Pacific
Reply:

mkdir $(date +%Y%m%d)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Working with dates

how to calculate date (urgent) www.computing.net/answers/unix/how-to-calculate-date-urgent/5352.html

Getting old date into variable www.computing.net/answers/unix/getting-old-date-into-variable/5223.html

Get Tomorrow's Date in ddmmyy www.computing.net/answers/unix/get-tomorrows-date-in-ddmmyy-/5648.html