bug fuss to print the time including zone

Discussion in 'Perl Misc' started by jidanni@jidanni.org, May 16, 2009.

  1. Guest

    Geez, to print the time including the timezone offset, it's either
    print localtime() . " +0800\n"; #Hardwire it, or
    print `date -R`; #Expensive
    Any other solution and were talking at least a three lines of code,
    "use", etc. no?
     
    , May 16, 2009
    #1
    1. Advertising

  2. wrote:
    > Geez, to print the time including the timezone offset, it's either
    > print localtime() . " +0800\n"; #Hardwire it, or
    > print `date -R`; #Expensive
    > Any other solution and were talking at least a three lines of code,
    > "use", etc. no?


    $ perl -le'use POSIX; print strftime "%F %T %z %Z", localtime'
    2009-05-15 23:15:10 -0700 PDT


    John
    --
    Those people who think they know everything are a great
    annoyance to those of us who do. -- Isaac Asimov
     
    John W. Krahn, May 16, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryu

    Time Zone in Windows Time

    Ryu, Sep 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    18,450
    madamut
    Feb 11, 2009
  2. =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=

    prevent a postback when moving web parts from zone to zone.

    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    593
    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=
    Feb 8, 2006
  3. davout
    Replies:
    3
    Views:
    578
    Roedy Green
    Oct 16, 2003
  4. J.H.Kim

    time adjustment code according to time zone

    J.H.Kim, Oct 24, 2011, in forum: C Programming
    Replies:
    3
    Views:
    485
    Joel C. Salomon
    Oct 24, 2011
  5. Replies:
    9
    Views:
    326
    Michal Kleczek
    May 27, 2013
Loading...

Share This Page