git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Date handling.

From
RARuss Allbery <rra@stanford.edu>
Date
Apr 24, 2005, 06:43 UTC
Message-ID
<87r7h0u12e.fsf@windlord.stanford.edu>
In-Reply-To
<1114324729.3419.78.camel@localhost.localdomain>
David Woodhouse <dwmw2@infradead.org> writes:
> I don't think we want to be in the business of counting leap seconds; we
> need to let the system do it. I don't much like setting TZ to UTC though
> -- how about we use your test case to find the offset and subtract that?
> Does this work?

Nope, daylight savings time breaks this, since you may or may not be in the same time zone on January 1st as you are at the current time.

However, you don't need to count leap seconds when you implement your own mktime, since mktime doesn't have to take leap seconds into account. Unix timestamps, unless you're using TAI, don't include leap seconds.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Previous: David WoodhouseNext: Jan Harkes
Message 10 of 13 in “Date handling.”
  1. David WoodhouseApr 14, 2005
  2. Linus TorvaldsApr 14, 2005
  3. Linus TorvaldsApr 14, 2005
  4. David WoodhouseApr 14, 2005
  5. tony.luck@intel.comApr 14, 2005
  6. David WoodhouseApr 14, 2005
  7. Jan HarkesApr 24, 2005
  8. James PurserApr 24, 2005
  9. David WoodhouseApr 24, 2005
  10. Russ AllberyApr 24, 2005
  11. Jan HarkesApr 25, 2005
  12. Russ AllberyApr 25, 2005
  13. David WoodhouseApr 14, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.