Yep, it's locale. I'm getting different results, depending on TZ value. But changing TZ after I've called UnixDate once doesn't have any effect.
#!/usr/bin/perl use strict; use warnings; use Date::Manip; use Data::Dumper; my $tot_start_date = '2008-06-27 17:37:11 +0000'; my $tot_end_date = '2008-09-29 04:02:18 +0000'; my $beta_start_date = '2008-09-29 04:02:18 +0000'; my $beta_end_date = '2009-01-07 00:00:00 -0800'; #$ENV{TZ}='America/Montreal'; $ENV{TZ}='UTC'; $tot_start_date = UnixDate($tot_start_date,"%Y-%m-%d"); $tot_end_date = UnixDate($tot_end_date,"%Y-%m-%d"); $beta_start_date = UnixDate($beta_start_date,"%Y-%m-%d"); $beta_end_date = UnixDate($beta_end_date,"%Y-%m-%d"); print Dumper $tot_start_date; print Dumper $tot_end_date; print Dumper $beta_start_date; print Dumper $beta_end_date; __END__ output for Montreal: $VAR1 = '2008-06-27'; $VAR1 = '2008-09-28'; $VAR1 = '2008-09-28'; $VAR1 = '2009-01-07'; output for UTC: $VAR1 = '2008-06-27'; $VAR1 = '2008-09-29'; $VAR1 = '2008-09-29'; $VAR1 = '2009-01-07';

In reply to Re: UnixDate - getting a different date by zwon
in thread UnixDate - getting a different date by d-evil

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.