Welcome to WebmasterWorld Guest from 54.162.214.65

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Comparing Dates

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

New User

5+ Year Member

joined:June 7, 2009
posts:13
votes: 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)
12:46 pm on June 15, 2009 (gmt 0)

New User

5+ Year Member

joined:June 11, 2009
posts:27
votes: 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.
1:06 pm on June 15, 2009 (gmt 0)

New User

5+ Year Member

joined:June 7, 2009
posts:13
votes: 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?
2:01 pm on June 15, 2009 (gmt 0)

New User

5+ Year Member

joined:June 11, 2009
posts:27
votes: 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.

2:51 pm on June 15, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Mar 29, 2007
posts:1147
votes: 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.

9:22 am on June 16, 2009 (gmt 0)

New User

5+ Year Member

joined:June 7, 2009
posts:13
votes: 0


thanks all..this helped

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

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members