homepage Welcome to WebmasterWorld Guest from 54.234.128.25
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Comparing Dates
PankajBansal




msg:3933423
 10:40 am on Jun 15, 2009 (gmt 0)

Is there any module through which i can compare dates?
I tried with "use DateTime", but it says can't locate DateTime.pm. Is there any other way i can compare dates (other than writing code for it)

 

mattdw




msg:3933475
 12:46 pm on Jun 15, 2009 (gmt 0)

Did you grab the DateTime module and install it from CPAN (or ppm if you are using Windows and ActivePerl)? DateTime isn't a default module that comes with Perl, so you have to explicitly install it before you can "use" it.

PankajBansal




msg:3933487
 1:06 pm on Jun 15, 2009 (gmt 0)

I am not sure i can download it from my office network. Anyway could you please tell from where can i download the same?

mattdw




msg:3933523
 2:01 pm on Jun 15, 2009 (gmt 0)

What operating system do you have Perl installed on? If it is Windows, try the PPM utility that should have come with the installation. If not, use the cpan command line utility. Just open up a shell session and type 'cpan DateTime'.

Alternatively, you can get it manually from CPAN and install it yourself, http:://search.cpan.org.

Dabrowski




msg:3933553
 2:51 pm on Jun 15, 2009 (gmt 0)

If you're on Windows installing yourself is such a pain!

PPM is brilliant:
Open a command prompt
Type 'ppm', it should find it in the path
At the ppm prompt type 'search datetime' and it should list the module
Type 'install datetime' and it will download and install it for you, and also any dependancies it has.

I've used timelocal in the past to convert dates/times to seconds and work out the difference in seconds between them.

PankajBansal




msg:3934169
 9:22 am on Jun 16, 2009 (gmt 0)

thanks all..this helped

[edited by: PankajBansal at 9:23 am (utc) on June 16, 2009]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved