Computing.Net > Forums > Unix > how to calculate days between 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.

how to calculate days between dates

Reply to Message Icon

Name: unixgirl
Date: April 3, 2007 at 10:20:24 Pacific
OS: Unix AIX
CPU/Ram: 512
Product: IBM
Comment:

I have two dates and I'd like to find how many days between these two dates? Ex:
04/03/07 - 03/31/07 should be 4 days!
Thanks


UnixGirl



Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: April 3, 2007 at 14:06:58 Pacific
Reply:

Hi unixgirl,

presently no other clue than to transform the dates: "daysofmonthspassed" + days (easy as long as in the same year, a bit more tricky to reflect leap years and dates covering different years)

sorry for the bad news

Wollie


0

Response Number 2
Name: nails
Date: April 3, 2007 at 14:35:18 Pacific
Reply:

We've discuss unix date arithmetic a lot in this forum. Take a look at:

http://computing.net/unix/wwwboard/...
http://computing.net/unix/wwwboard/...

Also, take a look William Robertson's excellent shift_date script:

http://www.williamrobertson.pwp.blu...


0

Response Number 3
Name: unixgirl
Date: April 4, 2007 at 12:14:34 Pacific
Reply:

Thanks Nails. I've actually took time to browse thru forum and found one of your response to 'uribo' on get_JD() function. I've used it and it worked on my script.
Thanks again.
UnixGirl


0

Response Number 4
Name: nails
Date: April 4, 2007 at 13:25:38 Pacific
Reply:

UnixGirl:

You're welcome. Glad to help.


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: how to calculate days between dates

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

calculate day www.computing.net/answers/unix/calculate-day/7586.html

How to calculate the time interval www.computing.net/answers/unix/how-to-calculate-the-time-interval-/7780.html