php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_date.h File Reference
#include "lib/timelib.h"
#include "Zend/zend_hash.h"
#include "php_version.h"

Go to the source code of this file.

Data Structures

struct  _php_date_obj
 
struct  _php_timezone_obj
 
struct  _php_interval_obj
 
struct  _php_period_obj
 

Macros

#define PHP_DATE_SIZEOF_LONG   4
 
#define PHP_DATE_DOUBLE_FITS_LONG(d)
 
#define PHP_DATE_VERSION   PHP_VERSION
 
#define phpext_date_ptr   &date_module_entry
 
#define Z_PHPDATE_P(zv)
 
#define Z_PHPTIMEZONE_P(zv)
 
#define PHP_DATE_CIVIL   1
 
#define PHP_DATE_WALL   2
 
#define Z_PHPINTERVAL_P(zv)
 
#define Z_PHPPERIOD_P(zv)
 
#define DATEG(v)
 
#define _php_strftime   php_strftime
 
#define PHP_DATE_INIT_CTOR   0x01
 
#define PHP_DATE_INIT_FORMAT   0x02
 

Typedefs

typedef struct _php_date_obj php_date_obj
 
typedef struct _php_timezone_obj php_timezone_obj
 
typedef struct _php_interval_obj php_interval_obj
 
typedef struct _php_period_obj php_period_obj
 

Functions

 PHP_RINIT_FUNCTION (date)
 
 PHP_RSHUTDOWN_FUNCTION (date)
 
 PHP_MINIT_FUNCTION (date)
 
 PHP_MSHUTDOWN_FUNCTION (date)
 
 PHP_MINFO_FUNCTION (date)
 
 ZEND_MODULE_POST_ZEND_DEACTIVATE_D (date)
 
PHPAPI time_t php_time (void)
 
PHPAPI zend_long php_parse_date (const char *string, zend_long *now)
 
PHPAPI void php_mktime (INTERNAL_FUNCTION_PARAMETERS, bool gmt)
 
PHPAPI int php_idate (char format, time_t ts, bool localtime)
 
PHPAPI void php_strftime (INTERNAL_FUNCTION_PARAMETERS, bool gm)
 
PHPAPI zend_stringphp_format_date (const char *format, size_t format_len, time_t ts, bool localtime)
 
PHPAPI zend_stringphp_format_date_obj (const char *format, size_t format_len, php_date_obj *date_obj)
 
PHPAPI void php_date_set_tzdb (timelib_tzdb *tzdb)
 
PHPAPI timelib_tzinfoget_timezone_info (void)
 
PHPAPI zend_class_entryphp_date_get_date_ce (void)
 
PHPAPI zend_class_entryphp_date_get_immutable_ce (void)
 
PHPAPI zend_class_entryphp_date_get_interface_ce (void)
 
PHPAPI zend_class_entryphp_date_get_timezone_ce (void)
 
PHPAPI zend_class_entryphp_date_get_interval_ce (void)
 
PHPAPI zend_class_entryphp_date_get_period_ce (void)
 
PHPAPI zvalphp_date_instantiate (zend_class_entry *pce, zval *object)
 
PHPAPI bool php_date_initialize (php_date_obj *dateobj, const char *time_str, size_t time_str_len, const char *format, zval *timezone_object, int flags)
 
PHPAPI void php_date_initialize_from_ts_long (php_date_obj *dateobj, zend_long sec, int usec)
 
PHPAPI bool php_date_initialize_from_ts_double (php_date_obj *dateobj, double ts)
 

Variables

zend_module_entry date_module_entry
 
char * default_timezone
 
char * timezone
 
HashTabletzcache
 
timelib_error_containerlast_errors
 

Macro Definition Documentation

◆ _php_strftime

#define _php_strftime   php_strftime

Definition at line 139 of file php_date.h.

◆ DATEG

#define DATEG ( v)
Value:
uint32_t v
Definition cdf.c:1237
date(string $format, ?int $timestamp=null)
#define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v)
Definition zend_API.h:274

Definition at line 130 of file php_date.h.

◆ PHP_DATE_CIVIL

#define PHP_DATE_CIVIL   1

Definition at line 86 of file php_date.h.

◆ PHP_DATE_DOUBLE_FITS_LONG

#define PHP_DATE_DOUBLE_FITS_LONG ( d)
Value:
(!((d) > (double)TIMELIB_LONG_MAX || (d) < (double)TIMELIB_LONG_MIN))
#define TIMELIB_LONG_MIN
Definition timelib.h:124
#define TIMELIB_LONG_MAX
Definition timelib.h:123

Definition at line 34 of file php_date.h.

◆ PHP_DATE_INIT_CTOR

#define PHP_DATE_INIT_CTOR   0x01

Definition at line 158 of file php_date.h.

◆ PHP_DATE_INIT_FORMAT

#define PHP_DATE_INIT_FORMAT   0x02

Definition at line 159 of file php_date.h.

◆ PHP_DATE_SIZEOF_LONG

#define PHP_DATE_SIZEOF_LONG   4

Definition at line 25 of file php_date.h.

◆ PHP_DATE_VERSION

#define PHP_DATE_VERSION   PHP_VERSION

Definition at line 41 of file php_date.h.

◆ PHP_DATE_WALL

#define PHP_DATE_WALL   2

Definition at line 87 of file php_date.h.

◆ phpext_date_ptr

#define phpext_date_ptr   &date_module_entry

Definition at line 44 of file php_date.h.

◆ Z_PHPDATE_P

#define Z_PHPDATE_P ( zv)
Value:
php_date_obj_from_obj(Z_OBJ_P((zv)))
zval * zv
Definition ffi.c:3975
#define Z_OBJ_P(zval_p)
Definition zend_types.h:990

Definition at line 67 of file php_date.h.

◆ Z_PHPINTERVAL_P

#define Z_PHPINTERVAL_P ( zv)
Value:
php_interval_obj_from_obj(Z_OBJ_P((zv)))

Definition at line 102 of file php_date.h.

◆ Z_PHPPERIOD_P

#define Z_PHPPERIOD_P ( zv)
Value:
php_period_obj_from_obj(Z_OBJ_P((zv)))

Definition at line 121 of file php_date.h.

◆ Z_PHPTIMEZONE_P

#define Z_PHPTIMEZONE_P ( zv)
Value:
php_timezone_obj_from_obj(Z_OBJ_P((zv)))

Definition at line 84 of file php_date.h.

Typedef Documentation

◆ php_date_obj

typedef struct _php_date_obj php_date_obj

Definition at line 53 of file php_date.h.

◆ php_interval_obj

Definition at line 55 of file php_date.h.

◆ php_period_obj

Definition at line 56 of file php_date.h.

◆ php_timezone_obj

Definition at line 54 of file php_date.h.

Function Documentation

◆ get_timezone_info()

PHPAPI timelib_tzinfo * get_timezone_info ( void )

Definition at line 573 of file php_date.c.

◆ php_date_get_date_ce()

PHPAPI zend_class_entry * php_date_get_date_ce ( void )

Definition at line 274 of file php_date.c.

◆ php_date_get_immutable_ce()

PHPAPI zend_class_entry * php_date_get_immutable_ce ( void )

Definition at line 279 of file php_date.c.

◆ php_date_get_interface_ce()

PHPAPI zend_class_entry * php_date_get_interface_ce ( void )

Definition at line 284 of file php_date.c.

◆ php_date_get_interval_ce()

PHPAPI zend_class_entry * php_date_get_interval_ce ( void )

Definition at line 294 of file php_date.c.

◆ php_date_get_period_ce()

PHPAPI zend_class_entry * php_date_get_period_ce ( void )

Definition at line 299 of file php_date.c.

◆ php_date_get_timezone_ce()

PHPAPI zend_class_entry * php_date_get_timezone_ce ( void )

Definition at line 289 of file php_date.c.

◆ php_date_initialize()

PHPAPI bool php_date_initialize ( php_date_obj * dateobj,
const char * time_str,
size_t time_str_len,
const char * format,
zval * timezone_object,
int flags )

Definition at line 2403 of file php_date.c.

◆ php_date_initialize_from_ts_double()

PHPAPI bool php_date_initialize_from_ts_double ( php_date_obj * dateobj,
double ts )

Definition at line 2529 of file php_date.c.

◆ php_date_initialize_from_ts_long()

PHPAPI void php_date_initialize_from_ts_long ( php_date_obj * dateobj,
zend_long sec,
int usec )

Definition at line 2519 of file php_date.c.

◆ php_date_instantiate()

PHPAPI zval * php_date_instantiate ( zend_class_entry * pce,
zval * object )

Definition at line 2356 of file php_date.c.

◆ php_date_set_tzdb()

PHPAPI void php_date_set_tzdb ( timelib_tzdb * tzdb)

Definition at line 1045 of file php_date.c.

◆ php_format_date()

PHPAPI zend_string * php_format_date ( const char * format,
size_t format_len,
time_t ts,
bool localtime )

Definition at line 875 of file php_date.c.

◆ php_format_date_obj()

PHPAPI zend_string * php_format_date_obj ( const char * format,
size_t format_len,
php_date_obj * date_obj )

Definition at line 846 of file php_date.c.

◆ php_idate()

PHPAPI int php_idate ( char format,
time_t ts,
bool localtime )

Definition at line 901 of file php_date.c.

◆ PHP_MINFO_FUNCTION()

PHP_MINFO_FUNCTION ( date )

Definition at line 484 of file php_date.c.

◆ PHP_MINIT_FUNCTION()

PHP_MINIT_FUNCTION ( date )

Definition at line 453 of file php_date.c.

◆ php_mktime()

PHPAPI void php_mktime ( INTERNAL_FUNCTION_PARAMETERS ,
bool gmt )

Definition at line 1141 of file php_date.c.

◆ PHP_MSHUTDOWN_FUNCTION()

PHP_MSHUTDOWN_FUNCTION ( date )

Definition at line 467 of file php_date.c.

◆ php_parse_date()

PHPAPI zend_long php_parse_date ( const char * string,
zend_long * now )

Definition at line 1057 of file php_date.c.

◆ PHP_RINIT_FUNCTION()

PHP_RINIT_FUNCTION ( date )

Definition at line 409 of file php_date.c.

◆ PHP_RSHUTDOWN_FUNCTION()

PHP_RSHUTDOWN_FUNCTION ( date )

Definition at line 423 of file php_date.c.

◆ php_strftime()

PHPAPI void php_strftime ( INTERNAL_FUNCTION_PARAMETERS ,
bool gm )

Definition at line 1257 of file php_date.c.

◆ php_time()

PHPAPI time_t php_time ( void )

Definition at line 56 of file php_date.c.

◆ ZEND_MODULE_POST_ZEND_DEACTIVATE_D()

ZEND_MODULE_POST_ZEND_DEACTIVATE_D ( date )

Definition at line 434 of file php_date.c.

Variable Documentation

◆ date_module_entry

zend_module_entry date_module_entry
extern

Definition at line 370 of file php_date.c.

◆ default_timezone

char* default_timezone

Definition at line 124 of file php_date.h.

◆ last_errors

Definition at line 127 of file php_date.h.

◆ timezone

char* timezone

Definition at line 125 of file php_date.h.

◆ tzcache

HashTable* tzcache

Definition at line 126 of file php_date.h.