Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# 01/08-15/04=? How can I calculate such a difference ?

Posted on 1999-07-19
Medium Priority
140 Views
Need a function that will say what's the difference
(in days) between dd/mm(1) and dd/mm(2) (01/08 - 15/04 = ?)
Friend of mine does it using time() and gmctime(), but
this way seems to me too complicated for such a little
problem. Is there sth simple for it ?
--== Thank's ! ==--
0
Question by:geniek
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 19

Accepted Solution

Kim Ryan earned 80 total points
ID: 1214261

use Date::Manip;
# set up dd/mm format
&Date_Init"DateFormat=nonUS");

\$date1=&ParseDate("01/08");
\$date2=&ParseDate("15/04");
\$delta=&DateCalc(\$date1,\$date2,\\$err);
# returns time in following format 0:0:DD:HH:MM:SS the days, hours, minutes, and seconds between the two

0

LVL 84

Expert Comment

ID: 1214262
use Time::Local;
#or
use Date::Manip;
#or
use Date::Calc;
#or
0

Author Comment

ID: 1214263

Thank's a lot !
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
###### Suggested Courses
Course of the Month5 days, 11 hours left to enroll