Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > Perl

Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-2007, 01:37 PM
mak mak is offline
Newbie
 
Join Date: Feb 2007
Posts: 2
Rep Power: 0
mak is on a distinguished road
Default Getting Time Zone

How can I find the time zone? The end result I need to figure out if the date/time is in daylight savings or not. I've found:

Perl Code:
  1. use POSIX (strftime);
  2.  
  3. ($d = strftime("%z", localtime)) =~ s/(\d\d)(\d\d)/$1:$2/;
  4.  
  5. print "$d\n";

which gives me this error:

"Unquoted string "strftime" may clash with future reserved word at timezone.pl line 12."

But it does output "Eastern Daylight Time". Is there a better way to do this or is there a way I can remove the warning?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-04-2007, 06:59 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default

use POSIX qw(strftime);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-05-2007, 07:54 AM
mak mak is offline
Newbie
 
Join Date: Feb 2007
Posts: 2
Rep Power: 0
mak is on a distinguished road
Default

That works! Thanks! What does the qw() mean?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-05-2007, 12:20 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default

qw = quote words

is the equivalent of:

use POSIX ("strftime");

Last edited by KevinADC; 10-06-2007 at 01:15 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: Execution Time Function Jordan PHP Tutorials 5 05-18-2008 07:12 PM
A time showing tutorial ahsan16 VB Tutorials 1 01-10-2007 04:50 AM
Execution Time smith PHP Forum 2 01-06-2007 03:46 PM
Time format xXHalfSliceXx HTML Programming 0 12-10-2006 07:15 PM
Odd Timestamp dirkfirst C# Programming 10 12-08-2006 04:40 PM


All times are GMT -5. The time now is 09:39 PM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads