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, 02: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, 07:59 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 91
Rep Power: 7
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, 08: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, 01:20 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 91
Rep Power: 7
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 02: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
Forum Jump

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


All times are GMT -5. The time now is 03:58 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads