You appear to be using Date::Manip ... correct?
  1. what time zone are all of these boxes running on?
    ParseDate assumes the TZ found in the environment when parsing, so "last sunday" in localtime can conceivable be noon the previous saturday (or thefollowing monday) in GMT. on top combine that you take the seconds since epoch returned by UnixDate and you then pass it to localtime ... which is only going to compound your problem.
  2. If you are going to use Date::Manip, why not use the Date_IsWorkDay function in conjuntion with teh configurable WorkWeekBeg, and WorkWeekEnd settings?

In general: make the message of your test give you more data (like exactly what 'time' (fully formated with an explicit timezone) you are passing to your function.


In reply to Re: Inscrutable test failure by hossman
in thread Inscrutable test failure by dsheroh

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.