2003-09-13 20:51:48 +00:00
|
|
|
/*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2003-09-13 20:51:48 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Copyright (C) 1999 - 2005, Digium, Inc.
|
2003-09-13 20:51:48 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Mark Spencer <markster@digium.com>
|
2003-09-13 20:51:48 +00:00
|
|
|
* Tilghman Lesher <tlesher@vcch.com>
|
|
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
|
* channels for your use.
|
|
|
|
|
*
|
2003-09-13 20:51:48 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
2005-08-30 18:32:10 +00:00
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
|
* at the top of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \file
|
|
|
|
|
* \brief Custom localtime functions for multiple timezones
|
2003-09-13 20:51:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _ASTERISK_LOCALTIME_H
|
|
|
|
|
#define _ASTERISK_LOCALTIME_H
|
|
|
|
|
|
2007-07-18 19:47:20 +00:00
|
|
|
struct ast_tm {
|
2007-12-11 14:17:29 +00:00
|
|
|
int tm_sec; /*!< Seconds. [0-60] (1 leap second) */
|
|
|
|
|
int tm_min; /*!< Minutes. [0-59] */
|
|
|
|
|
int tm_hour; /*!< Hours. [0-23] */
|
|
|
|
|
int tm_mday; /*!< Day. [1-31] */
|
|
|
|
|
int tm_mon; /*!< Month. [0-11] */
|
|
|
|
|
int tm_year; /*!< Year - 1900. */
|
|
|
|
|
int tm_wday; /*!< Day of week. [0-6] */
|
|
|
|
|
int tm_yday; /*!< Days in year.[0-365] */
|
|
|
|
|
int tm_isdst; /*!< DST. [-1/0/1]*/
|
|
|
|
|
long int tm_gmtoff; /*!< Seconds east of UTC. */
|
|
|
|
|
char *tm_zone; /*!< Timezone abbreviation. */
|
2007-07-18 19:47:20 +00:00
|
|
|
/* NOTE: do NOT reorder this final item. The order needs to remain compatible with struct tm */
|
2007-12-11 14:17:29 +00:00
|
|
|
int tm_usec; /*!< microseconds */
|
2007-07-18 19:47:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ast_tm *ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone);
|
2008-01-09 21:37:26 +00:00
|
|
|
void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_start, time_t *dst_end, int *gmt_off, const char * const zone);
|
2007-09-12 21:25:57 +00:00
|
|
|
struct timeval ast_mktime(struct ast_tm * const tmp, const char *zone);
|
2007-07-18 19:47:20 +00:00
|
|
|
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm);
|
2003-09-13 20:51:48 +00:00
|
|
|
|
2005-08-30 18:32:10 +00:00
|
|
|
#endif /* _ASTERISK_LOCALTIME_H */
|