Help with Date / Time

H

Hoops

Hello,


I'm brand new with Perl and I'm just trying to fix the date and time
of a program that someone else wrote.



The line shows this:


$date = date("l dS of F Y h:i:s A");



I need to change it to read the correct date/time for U.S. PST.



Any help would be appreciated.
 
E

Eric Bohlman

I'm brand new with Perl and I'm just trying to fix the date and time
of a program that someone else wrote.



The line shows this:


$date = date("l dS of F Y h:i:s A");



I need to change it to read the correct date/time for U.S. PST.

Perl doesn't have a built-in date() function, so the program must either be
defining one itself or using a module that contains a date() function. If
the latter, you'll need to determine what module it is (look for lines
starting with 'use' toward the beginning of the program) and then look at
that module's documentation to find out what the function is expecting (I
don't know offhand which of the several date-related modules it's from).
If the former, good luck! (that would mean that the original author defined
his own function, and when people re-invent the wheel like that, they only
rarely document it adequately).

Scary thought: that format did remind me of something, and I just realized
what it was: the built-in date() function in PHP! Are you *sure* you're
dealing with *Perl* code here? (if there's a 'use PHP::DateTime;' toward
the beginning of the program, then you really are)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top