[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2275: ctime(3) should be replaced by newctime(3)



Package: manpages
Version: 1.9-2

Package: timezone
Version: 7.46-0

I have been nibbling for months on a C programming problem concerning time
conversion. I had been using mktime(3) instead of timegm(3). Both turn a
time_t into a struct tm, but only the latter produces universal Greenwhich
time (UTC, GMT) which is what I needed.

ctime(3) says that mktime(3) produces UTC which is wrong as it converts into
the local timezone.

newctime(3), which comes with the timezone package, does state this
correctly. But newctime(3) does not mention timegm(), and the struct tm info
on that manpage does not correspond to the one in /usr/include/time.h as
newctime(3) declares the tm_zone and tm_gmtoff fields which don't seem to be
in libc5. I didn't link against /usr/lib/libz.a.

newctime(3) should probably replace ctime(3) in the manpages package.

--
Dirk Eddelb"uttel                              http://qed.econ.queensu.ca/~edd


Reply to: