Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 9, 2004, 4:07 am
rate this thread
Re: Help with Date / Time
> 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)