Thanks for your reply, SBECK.

Yes, a full date/time needs to include the timezone. So why does Date::Manip just return a string that has no timezone in it? Is there a way to make it append the timezone?

And yes, the second question depends on what I mean by 'one day ago'. In this case, I mean 'the same time yesterday'. I don't think that's ambiguous: if I'm supposed to turn up to work at 8am on Friday, and do the same on Monday after the change to or from summer time, it's up to me to make the adjustment. In both cases, it's assumed that we're talking about 'local time'.

I hoped that Date::Manip would do that if I used 'approximate' mode, but apparently not.

Is there another option to get Date::Manip to do what I want?

My definition of '1 day' is: 24 hours, unless the period spans the change to/from daylight saving, in which case it's either 23 or 25 hours (in most countries).

If I want to go back 24 hours, I can use a delta such as '-0:0:-0:0:24:0:0'. But if I want to go back 1 day, then I feel that '-0:0:-0:1:0:0:0' should do the right thing.

cheers

Chris


In reply to Re^4: Date::Manip and daylight savings by ChrisDennis
in thread Date::Manip and daylight savings by ChrisDennis

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.