00001 /* 00002 * Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") 00003 * 00004 * Permission to use, copy, modify, and/or distribute this software for any 00005 * purpose with or without fee is hereby granted, provided that the above 00006 * copyright notice and this permission notice appear in all copies. 00007 * 00008 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 00009 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00010 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 00011 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00012 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00013 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00014 * PERFORMANCE OF THIS SOFTWARE. 00015 */ 00016 00017 #ifndef ISC_TM_H 00018 #define ISC_TM_H 1 00019 00020 /*! \file isc/tm.h 00021 * Provides portable conversion routines for struct tm. 00022 */ 00023 #include <time.h> 00024 00025 #include <isc/lang.h> 00026 #include <isc/types.h> 00027 00028 00029 ISC_LANG_BEGINDECLS 00030 00031 time_t 00032 isc_tm_timegm(struct tm *tm); 00033 /* 00034 * Convert a tm structure to time_t, using UTC rather than the local 00035 * time zone. 00036 */ 00037 00038 char * 00039 isc_tm_strptime(const char *buf, const char *fmt, struct tm *tm); 00040 /* 00041 * Parse a formatted date string into struct tm. 00042 */ 00043 00044 ISC_LANG_ENDDECLS 00045 00046 #endif /* ISC_TIMER_H */