Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 22nd, 2001, 10:28 AM
walshs walshs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 112 walshs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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
__________________
World Cup Football (Soccer) Forums
http://www.todayinsoccer.com

Reply With Quote
  #2  
Old May 22nd, 2001, 03:41 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Thumbs up

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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Time Problem , Convert PHP Function To Perl Need Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT