Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Anyone know how to get DateTime::Format::W3CDTF, or DateTimeX::Web to print localtime?

by taint (Chaplain)
on Nov 26, 2013 at 21:44 UTC ( [id://1064484]=note: print w/replies, xml ) Need Help??


in reply to Re: Anyone know how to get DateTime::Format::W3CDTF, or DateTimeX::Web to print localtime?
in thread Anyone know how to get DateTime::Format::W3CDTF, or DateTimeX::Web to print localtime?

"What code where?"
If I understand that correctly; I was too embarrassed to post it.

Your eloquent example proves (to me) I was over complicating things -- everything doesn't need to be a science project. :P

Thanks. It was perfect.

--Chris

#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;
  • Comment on Re^2: Anyone know how to get DateTime::Format::W3CDTF, or DateTimeX::Web to print localtime?

Replies are listed 'Best First'.
Re^3: Anyone know how to get DateTime::Format::W3CDTF, or DateTimeX::Web to print localtime? (what was I thinking, learning moments)
by Anonymous Monk on Nov 26, 2013 at 22:14 UTC

    ...

    Its a process and a puzzle :) Sometimes you're missing a corner piece, sometimes you need a break (or a nap), this is a learning moment, so it helps to be able to answer "what was I thinking" and write that down (don't have to share , but put it in your notes) ....

    thats how checklists are born; sometimes they're general, more often they're about your thinking process; if you identify big ones, you can remember them for next time, so you'll know to take a break :) approach from a different angle ...

    :) Cheers

      Thanks for your thoughtful response.

      Actually, I'm suffering a massive headache. The worst part is; I wasn't drinking. So I'm suffering without having the benefit of having had a great time. :(

      Now having been given a little focus (the example above). It occurred to me, that given I almost always use
      POSIX qw(strftime);
      for any of my Date/Time related stuff. I could have simply done:

      use POSIX qw(strftime); my $w3cstring = strftime "%FT%H:%I:%S", localtime; print $w3cstring;
      Which would have returned the equivalent:
      2013-11-26T14:02:48
      In fact better; as I wasn't looking for the TZ. Which is appended, using the example provided earlier in this thread.

      Thanks again, for the thoughtful response.

      --Chris

      #!/usr/bin/perl -Tw
      use Perl::Always or die;
      my $perl_version = (5.12.5);
      print $perl_version;
        POSIX is great, but the microsoft strftime implementation doesn't have %F, maybe its important to you :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-18 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found