2005-06-14 21:32:29 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| PHP Version 5 |
|
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| Copyright (c) 1997-2006 The PHP Group |
|
2005-06-14 21:32:29 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2005-06-14 21:32:29 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 12:51:34 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2005-06-14 21:32:29 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
2005-06-17 14:54:00 +00:00
|
|
|
| Authors: Derick Rethans <derick@derickrethans.nl> |
|
2005-06-14 21:32:29 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef PHP_DATE_H
|
|
|
|
#define PHP_DATE_H
|
|
|
|
|
2005-10-03 11:17:28 +00:00
|
|
|
#include "lib/timelib.h"
|
2005-10-05 08:20:44 +00:00
|
|
|
#include "Zend/zend_hash.h"
|
2005-10-03 11:17:28 +00:00
|
|
|
|
2005-06-14 21:32:29 +00:00
|
|
|
extern zend_module_entry date_module_entry;
|
|
|
|
#define phpext_date_ptr &date_module_entry
|
|
|
|
|
2005-06-30 21:38:06 +00:00
|
|
|
PHP_FUNCTION(date);
|
2005-11-29 23:10:15 +00:00
|
|
|
PHP_FUNCTION(idate);
|
2005-06-30 21:38:06 +00:00
|
|
|
PHP_FUNCTION(gmdate);
|
2005-07-02 21:19:25 +00:00
|
|
|
PHP_FUNCTION(strtotime);
|
2005-07-03 14:27:31 +00:00
|
|
|
|
|
|
|
PHP_FUNCTION(mktime);
|
|
|
|
PHP_FUNCTION(gmmktime);
|
|
|
|
|
2005-07-03 19:14:55 +00:00
|
|
|
PHP_FUNCTION(checkdate);
|
|
|
|
|
2005-07-03 23:30:52 +00:00
|
|
|
#ifdef HAVE_STRFTIME
|
2005-07-03 19:14:55 +00:00
|
|
|
PHP_FUNCTION(strftime);
|
|
|
|
PHP_FUNCTION(gmstrftime);
|
|
|
|
#endif
|
|
|
|
|
2005-07-03 20:45:08 +00:00
|
|
|
PHP_FUNCTION(time);
|
|
|
|
PHP_FUNCTION(localtime);
|
|
|
|
PHP_FUNCTION(getdate);
|
|
|
|
|
2005-07-20 08:31:02 +00:00
|
|
|
/* Advanced Interface */
|
2006-08-01 13:28:28 +00:00
|
|
|
PHP_METHOD(DateTime, __construct);
|
2005-07-20 08:31:02 +00:00
|
|
|
PHP_FUNCTION(date_create);
|
2006-04-11 18:03:52 +00:00
|
|
|
PHP_FUNCTION(date_parse);
|
2005-07-20 08:31:02 +00:00
|
|
|
PHP_FUNCTION(date_format);
|
|
|
|
PHP_FUNCTION(date_modify);
|
|
|
|
PHP_FUNCTION(date_timezone_get);
|
|
|
|
PHP_FUNCTION(date_timezone_set);
|
|
|
|
PHP_FUNCTION(date_offset_get);
|
|
|
|
|
2005-09-02 14:58:01 +00:00
|
|
|
PHP_FUNCTION(date_time_set);
|
|
|
|
PHP_FUNCTION(date_date_set);
|
|
|
|
PHP_FUNCTION(date_isodate_set);
|
|
|
|
|
2006-08-01 13:28:28 +00:00
|
|
|
PHP_METHOD(DateTimeZone, __construct);
|
2005-07-20 08:31:02 +00:00
|
|
|
PHP_FUNCTION(timezone_open);
|
|
|
|
PHP_FUNCTION(timezone_name_get);
|
2006-04-11 18:03:52 +00:00
|
|
|
PHP_FUNCTION(timezone_name_from_abbr);
|
2005-07-20 08:31:02 +00:00
|
|
|
PHP_FUNCTION(timezone_offset_get);
|
2006-08-01 13:28:28 +00:00
|
|
|
PHP_FUNCTION(timezone_transitions_get);
|
2005-07-20 08:31:02 +00:00
|
|
|
PHP_FUNCTION(timezone_identifiers_list);
|
|
|
|
PHP_FUNCTION(timezone_abbreviations_list);
|
|
|
|
|
|
|
|
/* Options and Configuration */
|
2005-07-04 21:27:26 +00:00
|
|
|
PHP_FUNCTION(date_default_timezone_set);
|
|
|
|
PHP_FUNCTION(date_default_timezone_get);
|
2005-06-14 21:32:29 +00:00
|
|
|
|
2006-01-04 21:31:35 +00:00
|
|
|
/* Astro functions */
|
|
|
|
PHP_FUNCTION(date_sunrise);
|
|
|
|
PHP_FUNCTION(date_sunset);
|
|
|
|
PHP_FUNCTION(date_sun_info);
|
|
|
|
|
2005-07-02 21:19:25 +00:00
|
|
|
PHP_RINIT_FUNCTION(date);
|
|
|
|
PHP_RSHUTDOWN_FUNCTION(date);
|
2005-06-14 21:32:29 +00:00
|
|
|
PHP_MINIT_FUNCTION(date);
|
|
|
|
PHP_MSHUTDOWN_FUNCTION(date);
|
|
|
|
PHP_MINFO_FUNCTION(date);
|
|
|
|
|
2005-06-18 20:23:19 +00:00
|
|
|
ZEND_BEGIN_MODULE_GLOBALS(date)
|
2005-10-05 08:20:44 +00:00
|
|
|
char *default_timezone;
|
|
|
|
char *timezone;
|
|
|
|
HashTable tzcache;
|
2005-06-18 20:23:19 +00:00
|
|
|
ZEND_END_MODULE_GLOBALS(date)
|
|
|
|
|
|
|
|
#ifdef ZTS
|
|
|
|
#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v)
|
|
|
|
#else
|
|
|
|
#define DATEG(v) (date_globals.v)
|
|
|
|
#endif
|
2005-06-14 21:32:29 +00:00
|
|
|
|
2005-06-19 22:15:27 +00:00
|
|
|
/* Backwards compability wrapper */
|
2006-01-28 06:18:01 +00:00
|
|
|
PHPAPI signed long php_parse_date(char *string, signed long *now);
|
2005-07-04 13:21:39 +00:00
|
|
|
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
|
2005-11-29 20:19:56 +00:00
|
|
|
PHPAPI int php_idate(char format, time_t ts, int localtime);
|
2005-07-03 19:14:55 +00:00
|
|
|
#if HAVE_STRFTIME
|
|
|
|
#define _php_strftime php_strftime
|
|
|
|
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
|
|
|
|
#endif
|
2005-08-25 09:47:28 +00:00
|
|
|
PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC);
|
2005-06-19 22:15:27 +00:00
|
|
|
|
2005-10-03 11:17:28 +00:00
|
|
|
/* Mechanism to set new TZ database */
|
|
|
|
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
|
2005-11-20 20:14:24 +00:00
|
|
|
PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
|
2005-10-03 11:17:28 +00:00
|
|
|
|
2005-06-14 21:32:29 +00:00
|
|
|
#endif /* PHP_DATE_H */
|