Family: none
Authors: Kevin S Braunsdorf
Mail: [email protected]
Version: 1.1
Bugs: none known
Introduction
When we want to sort text dates we need to contvert them to a form
that is easier to compare, like seconds since the Epoch. This code
does just that.
Configuration
- #define HAVE_ZONE_IN_TM
-
Define this macro to be true (non-zero) when the local OS
holds a timezome in a (struct tm) members (
char *tm_zone
)
and (long tm_gmtoff
).
The macro could be included in a machine.h
, or from
the compiler command line.
Provides
The two functions described below.
C Identifiers
- void
- unCtimeInit();
-
Call this once to setup the timezome in the converion buffer.
- time_t
- unCtime(const char *pcWhen)
-
Return the (time_t) value which when given to
ctime
should return the value input. This assumes that the input string
is well-formed ctime
output, of course.
To Do List
Check the input string a little better for format. The code assumes the
string is really a ctime(3) result.
$Id: unctime.html,v 1.7 2012/03/21 16:15:05 ksb Exp $