Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date calculation - future date in x days 1

Status
Not open for further replies.

ringd

Programmer
Jul 11, 2000
35
GB
Hello!

Does anyone know of any ways of calculating the date in (for example) 180 days time, other than coding it "long-hand"?

Any suggestions would be appreciated!

Cheers,
Dave.
 
Hi

If you have GNU [tt]date[/tt] :
Code:
[blue]master #[/blue] date
Fri Jan  5 19:58:17 EEST 2007

[blue]master #[/blue] date -d +180days
Wed Jul  4 20:58:23 EEDT 2007

Feherke.
 
PHV has written an excellent FAQ (faq80-4800) in the General Unix Discussion forum. I've copied and amended this code into many of my date dependant scripts.

Ceci n'est pas une signature
Columb Healy
 
I agree with columb - I use PHV's techniques in multiple shell scripts and it works flawlessly.

Tom

"My mind is like a steel whatchamacallit ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top