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

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



Good morning folks,

}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.

Dirk, could you tell me where the manpage says this? I cannot find
this. OTOH it doesn't tell that it is local time (which I will change
soon).

}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.

Fernando Alegre, what do you think about this?

I think the best would be to keep ctime(3) and put a reference "SEE
ALSO" to newctime(3) and vice versa. As timezone is a required package
it should be available in any case.

Dirk, is that okay for you?

Regards,

	Joey

--
  / Martin Schulze  *  joey@infodrom.north.de  *  26129 Oldenburg /
 / This copy of Netscape has expired.  -- Netscape               /
/                    Ein weiterer Grund Mosaic zu benutzen. :-( /


Reply to: