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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate date difference

Status
Not open for further replies.

Vandy02

Programmer
Jan 7, 2003
151
0
0
US
How do I caclualte the difference between two dates:
ie. startdate - enddate ????

thanks
 
This is difficult in shell scripting and easy in perl. Do you have access to perl?
 
thread822-775255

This thread shows how to convert a date to Julian date. After you convert both dates to Julian format, just subtract one date from another.

-------------------------
The trouble with doing something right the first time is that noboby appreciates how difficult it was.
- Steven Wright
 
[ $(date +%u) -eq 7 ] && echo Sunday

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top