Mail Archives: djgpp/2000/11/10/07:30:21
Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comremovebullcr_p> wrote:
> How can a DJGPP program convert two different time formats to time_t,
> using POSIX functions?
If I'm not totally mistaken after consulting some Unix systems'
manpages, you can't. At least not easily. The function you would need
is strptime(). But that doesn't seem to be required even by POSIX.
Only the X/Open group standard set of library functions 'XPG4' seems
to include it.
So you'll have to parse the individual elements yourself by sscanf(),
fill them into 'struct tm' and mktime() that to get a 'time_t' value.
It might be a good idea to emulate strptime(), and only compile it in
if the system you're compiling on doesn't provide strptime(), itself.
AFAIK, DJGPP does not have strptime().
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -