in reply to Printing current date and time

print scalar localtime;
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re: Re: Probably the easiest SOPW today!
by DamnDirtyApe (Curate) on Sep 22, 2002 at 20:04 UTC

    scalar localtime misses the time zone that appears in the OP's example. I'd use strftime to get it exact.

    $ perl -e 'print scalar localtime, "\n"' Sun Sep 22 13:01:42 2002 $ perl '-MPOSIX qw(strftime)' -e 'print strftime( "%a %b %d %T %Z %Y", + localtime ), "\n"' Sun Sep 22 13:01:48 PDT 2002

    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche