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
3
Medium Priority
?
140 Views
Last Modified: 2010-03-04
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
Comment
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
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
Kim Ryan earned 80 total points
ID: 1214261
Download the Date::Manip module from CPAN

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

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

Author Comment

by:geniek
ID: 1214263

 Thank's a lot !
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question