Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: problem with 'strftime' on unix systems

by davorg (Chancellor)
on Oct 23, 2006 at 11:06 UTC ( [id://579987]=note: print w/replies, xml ) Need Help??


in reply to problem with 'strftime' on unix systems

Looks like you're right and %s isn't supported in all strftime implementations.

Seems a bit pointless here tho'. Your variable $t already contains the number of seconds since the epoch. Why would you want to convert it?

--
<http://dave.org.uk>

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

  • Comment on Re: problem with 'strftime' on unix systems

Replies are listed 'Best First'.
Re^2: problem with 'strftime' on unix systems
by gellyfish (Monsignor) on Oct 23, 2006 at 11:12 UTC

    Probably to change the timezone at a guess.

    /J\

      But the epoch isn't effected by timezone. It's the number of seconds since 00:00 on 1st Jan 1970 GMT. I can't see how you'll ever get different answers from:

      print strftime '%s', localtime;

      and

      print time;

      Am I missing something?

      --
      <http://dave.org.uk>

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

        No I don't think you are missing something, it was just the only semi-plausible reason that I could think of that someone might think they want to do that.

        /J\

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-06-15 23:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.