Subject: Re: libc timegm()
To: Wolfgang S. Rupprecht <wolfgang+gnus20031109T123742@wsrcc.com>
From: Luke Mewburn <lukem@NetBSD.org>
List: netbsd-users
Date: 11/10/2003 11:30:58
On Sun, Nov 09, 2003 at 12:47:08PM -0800, Wolfgang  S. Rupprecht wrote:
  | Is libc's timegm(3) depreciated?  It is missing from mktime(3) man
  | page and I can't decide if it is on its way out or if this is a
  | documentation oversight.
  | 
  | timegm() cuts out a lot of nonsense when converting a UTC time in
  | Y/M/D H:M:S to seconds_since_the_epoch so it would be a good thing to
  | retain and document.

I agree that timegm() is good functionality to retain, since there's no
other easy way to convert a UTC struct tm (e.g, parsed with strptime(3))
to a UTC time_t.

On a related note, a function similar to tzset(3) that took a
timezone argument rather than requiring the $TZ environment to be
modified would allow mktime(3) to be used.  

I'm not sure if there's a standardized API for either of these features.