|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello there!
Could anyone please suggest a way to do calculations with date and time in perl. Could you please suggest the functions related to date and time. Thanks in advance Dups |
|
#2
|
||||
|
||||
|
Depending what format of the date and time your using, using the time(); function works very well for calculating date and times. Or check into the POSIX qw(strftime) module
Mickalo [Edited by mickalo on 02-27-2001 at 12:31 PM]
__________________
Thunder Rain Internet Publishing Custom Programming & Database development Providing Personal/Business Internet Solutions that work! |
|
#3
|
|||
|
|||
|
use POSIX qw/strftime/;
$time = strftime( "%A, %B %d, %Y", localtime(time()) ); would return the time in "Weekday, Month Day, Year" format. [Edited by JonLed on 02-27-2001 at 02:02 PM] |
|
#4
|
|||
|
|||
|
more doubts about date calculations
Hello there,
Thank u very much JohnLed and mickalo. What u suggested became very useful to me. I would like to know whether there are more functions related to date and time. I want to find the days between 2 dates. Also I have to add the no: of days to a date and get the new date. Could u suggest some sites which provide this information Thank u again Dups |
|
#5
|
|||
|
|||
|
http://search.cpan.org/doc/JHI/perl...POSIX/POSIX.pod
All kinds of great stuff in the POSIX module (well beyond just date/time functions). I'm sure you can get what you're looking for by combining some of the functions in creative ways . |
|
#6
|
|||
|
|||
|
Hello
I found a module DateCalcLib.pm somewhere. It does all the calculations that i need . Wouln't that be good. Is that a good module? But it is not provided by cpan. Could u please suggest from where i can get it. Thank u Dups |
|
#7
|
|||
|
|||
|
I don't know , and I'm sure it's a good module, it's just that POSIX is standard distribution with perl, so you'll more than likely have it installed already. I suggest you just figure it out.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > date and time functions in perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|