Your computer system keeps track of an internal date/time (typically rendered as an integer number or a UTC date) and an offset based on timezone and daylight savings (DST) table information.

The timezone is set manually by the system administrator usually by providing information on the city/state/country where the computer is located. It can also be set/changed more directly.
The table that contains start/end dates for daylight saving seasons per country/state/timezone gets shipped with the operating system software. So if the government would decide to deviate from the regular daylight savings season start and enddate this might upset a lot of computers.

As it does not change by timezone or daylight savings period, the internal system time is consistent across the world. That makes it an excellent standard for communications between computers, for timestamps in a computer, inter-process communication etc etc.
The Perl functions time(), gmtime() and timegm() all relate to this internal system time. So this is the reason why they do not adapt when day savings period starts.
NB: timegm() is located in the core module Time::Local

There's one problem with the above functions and the system time: unless you happen to be located in the United Kingdom AND the date is outside the daylight savings season the internal system time in UTC will most certainly be different from the date and time locally in your country/state.

This is where Perl function localtime() helps out. It takes the internal system time and applies an offset to it based on timezone and DST information to calculate the locally applicable date and time.


In reply to Re: Time Issues by varian
in thread Time Issues by Anonymous Monk

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.