Help with Date / Time

Discussion in 'Perl Misc' started by Hoops, Aug 9, 2004.

  1. Hoops

    Hoops Guest


    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.
    Hoops, Aug 9, 2004
    1. Advertisements

  2. Hoops

    Eric Bohlman Guest

    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)
    Eric Bohlman, Aug 9, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.