Like everything else Date or Time-like, Date::Manip handles that quite well, I think.
Date_ConvTZ $date=&Date_ConvTZ($date); $date=&Date_ConvTZ($date,$from); $date=&Date_ConvTZ($date,"",$to); $date=&Date_ConvTZ($date,$from,$to); This converts a date (which MUST be in the format returned by ParseDate) from one timezone to another. If it is called with no arguments, the date is con­ verted from the local timezone to the timezone speci­ fied by the config variable ConvTZ (see documentation on ConvTZ below). If ConvTZ is set to "IGNORE", no conversion is done. If called with $from but no $to, the timezone is con­ verted from the timezone in $from to ConvTZ (of TZ if ConvTZ is not set). Again, no conversion is done if ConvTZ is set to "IGNORE". If called with $to but no $from, $from defaults to ConvTZ (if set) or the local timezone otherwise. Although this does not seem immediately obvious, it actually makes sense. By default, all dates that are parsed are converted to ConvTZ, so most of the dates being worked with will be stored in that timezone. If Date_ConvTZ is called with both $from and $to, the date is converted from the timezone $from to $to. NOTE: As in all other cases, the $date returned from Date_ConvTZ has no timezone information included as part of it, so calling UnixDate with the "%z" format will return the timezone that Date::Manip is working in (usually the local timezone). Example: To convert 2/2/96 noon PST to CST (regard­ less of what timezone you are in, do the following: $date=&ParseDate("2/2/96 noon"); $date=&Date_ConvTZ($date,"PST","CST"); Both timezones MUST be in one of the formats listed below in the section TIMEZONES.
But read the caveats in the D::M docs; it might be slower than other solution.
--
Mike

In reply to Re: Bottling time by RMGir
in thread Bottling time by rendler

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.