I ran into some strange behaviour using Date::Manip 6.40 on perl 5.12.4 in Fedora 14 and I'm wondering if anyone has any thoughts on it.

Running the following code:

#!/usr/bin/perl use strict; use Date::Manip; Date_Init("TZ=+0930"); my $localtime = "1349541878"; printf("%s:%s:%s\n", $localtime, scalar localtime( $localtime ), UnixD +ate( scalar localtime( $localtime ), qq{%Y-%m-%d %H:%M:%S} ) ); $localtime = "1362112603"; printf("%s:%s:%s\n", $localtime, scalar localtime( $localtime ), UnixD +ate( scalar localtime( $localtime ), qq{%Y-%m-%d %H:%M:%S} ) );

Returns:

WARNING: [printf] Object must contain a valid date Missing argument in printf at /tmp/time.pl line 8. 1349541878:Sun Oct 7 02:14:38 2012: 1362112603:Fri Mar 1 14:06:43 2013:2013-03-01 14:06:43

Now, that's a real time zone (Australian Central Standard Time), in case anyone was wondering.

Anyone have any insight into this issue?

The error was originally experienced on Date::Manip 6.22, upgrading to 6.40 removed the WARNING message, but reproduced the same behaviour.

Now, I don't need to resolve the issue, but am interested in understanding it. I appreciate any info.


In reply to No value returned when using Date_Init by Synonymous Bosch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.