|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Time Problem , Convert PHP Function To Perl Need Help
Hi
i have a function that takes a starting point 25-12-99 and works out the weeks elapsed since then by using the code below this is in PHP. I need to write a similar thing in Perl , i am not too clued up on the Perl time function. I need help , can anyone suggest a way to do it sample code would help. $month = 7; $days = 12; $year = 2002; $week1 = date ("M d Y", mktime (0,0,0,12,25,1999)); $stw= date ("M d Y", mktime (0,0,0,$month,$days,$year)); while ($stw != $week1){ ++$ccd; $minus = $ccd*7; $stw = date("M d Y", mktime (0,0,0,$month,$days-$minus,$year)); } echo "the number weeks gone are $ccd"; reagrds Waseem |
|
#2
|
||||
|
||||
|
Check the Time::Local module at Cpan. This module should be already be installed on your server. Handles date/time conversion very nicely.
Mickalo ![]()
__________________
Thunder Rain Internet Publishing Custom Programming & Database development Providing Personal/Business Internet Solutions that work! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Time Problem , Convert PHP Function To Perl Need Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|