Lines Matching refs:dateobj
1931 static void date_object_to_hash(php_date_obj *dateobj, HashTable *props) in date_object_to_hash() argument
1936 ZVAL_STR(&zv, date_format("x-m-d H:i:s.u", sizeof("x-m-d H:i:s.u")-1, dateobj->time, 1)); in date_object_to_hash()
1940 if (dateobj->time->is_localtime) { in date_object_to_hash()
1941 ZVAL_LONG(&zv, dateobj->time->zone_type); in date_object_to_hash()
1944 switch (dateobj->time->zone_type) { in date_object_to_hash()
1946 ZVAL_STRING(&zv, dateobj->time->tz_info->name); in date_object_to_hash()
1950 int utc_offset = dateobj->time->z; in date_object_to_hash()
1961 ZVAL_STRING(&zv, dateobj->time->tz_abbr); in date_object_to_hash()
1971 php_date_obj *dateobj; in date_object_get_properties_for() local
1984 dateobj = php_date_obj_from_obj(object); in date_object_get_properties_for()
1986 if (!dateobj->time) { in date_object_get_properties_for()
1990 date_object_to_hash(dateobj, props); in date_object_get_properties_for()
2403 PHPAPI bool php_date_initialize(php_date_obj *dateobj, const char *time_str, size_t time_str_len, c… in php_date_initialize() argument
2415 if (dateobj->time) { in php_date_initialize()
2416 timelib_time_dtor(dateobj->time); in php_date_initialize()
2422 …dateobj->time = timelib_parse_from_format(format, time_str, time_str_len, &err, DATE_TIMEZONEDB, p… in php_date_initialize()
2428 …dateobj->time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tz… in php_date_initialize()
2441 timelib_time_dtor(dateobj->time); in php_date_initialize()
2442 dateobj->time = 0; in php_date_initialize()
2467 } else if (dateobj->time->tz_info) { in php_date_initialize()
2468 tzi = dateobj->time->tz_info; in php_date_initialize()
2498 timelib_time_dtor(dateobj->time); in php_date_initialize()
2499 dateobj->time = now; in php_date_initialize()
2507 timelib_fill_holes(dateobj->time, now, options); in php_date_initialize()
2509 timelib_update_ts(dateobj->time, tzi); in php_date_initialize()
2510 timelib_update_from_sse(dateobj->time); in php_date_initialize()
2512 dateobj->time->have_relative = 0; in php_date_initialize()
2519 PHPAPI void php_date_initialize_from_ts_long(php_date_obj *dateobj, zend_long sec, int usec) /* {{{… in php_date_initialize_from_ts_long() argument
2521 dateobj->time = timelib_time_ctor(); in php_date_initialize_from_ts_long()
2522 dateobj->time->zone_type = TIMELIB_ZONETYPE_OFFSET; in php_date_initialize_from_ts_long()
2524 timelib_unixtime2gmt(dateobj->time, (timelib_sll)sec); in php_date_initialize_from_ts_long()
2525 timelib_update_ts(dateobj->time, NULL); in php_date_initialize_from_ts_long()
2526 php_date_set_time_fraction(dateobj->time, usec); in php_date_initialize_from_ts_long()
2529 PHPAPI bool php_date_initialize_from_ts_double(php_date_obj *dateobj, double ts) /* {{{ */ in php_date_initialize_from_ts_double() argument
2572 php_date_initialize_from_ts_long(dateobj, sec, usec); in php_date_initialize_from_ts_double()
2847 static bool php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht) in php_date_initialize_from_hash() argument
2876 bool ret = php_date_initialize(*dateobj, ZSTR_VAL(tmp), ZSTR_LEN(tmp), NULL, NULL, 0); in php_date_initialize_from_hash()
2896 ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0); in php_date_initialize_from_hash()
2907 php_date_obj *dateobj; in PHP_METHOD() local
2918 dateobj = Z_PHPDATE_P(return_value); in PHP_METHOD()
2919 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
2929 php_date_obj *dateobj; in PHP_METHOD() local
2940 dateobj = Z_PHPDATE_P(return_value); in PHP_METHOD()
2941 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
2952 php_date_obj *dateobj; in PHP_METHOD() local
2957 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
2958 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_METHOD()
2962 date_object_to_hash(dateobj, myht); in PHP_METHOD()
2964 add_common_properties(myht, &dateobj->std); in PHP_METHOD()
2972 php_date_obj *dateobj; in PHP_METHOD() local
2977 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
2978 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_METHOD()
2982 date_object_to_hash(dateobj, myht); in PHP_METHOD()
2984 add_common_properties(myht, &dateobj->std); in PHP_METHOD()
3017 php_date_obj *dateobj; in PHP_METHOD() local
3025 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3028 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
3041 php_date_obj *dateobj; in PHP_METHOD() local
3049 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3052 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
3065 php_date_obj *dateobj; in PHP_METHOD() local
3070 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3074 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
3085 php_date_obj *dateobj; in PHP_METHOD() local
3090 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3094 if (!php_date_initialize_from_hash(&dateobj, myht)) { in PHP_METHOD()
3247 php_date_obj *dateobj; in PHP_FUNCTION() local
3254 dateobj = Z_PHPDATE_P(object); in PHP_FUNCTION()
3255 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_FUNCTION()
3256 RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime)); in PHP_FUNCTION()
3262 php_date_obj *dateobj; in php_date_modify() local
3266 dateobj = Z_PHPDATE_P(object); in php_date_modify()
3268 if (!(dateobj->time)) { in php_date_modify()
3288 memcpy(&dateobj->time->relative, &tmp_time->relative, sizeof(timelib_rel_time)); in php_date_modify()
3289 dateobj->time->have_relative = tmp_time->have_relative; in php_date_modify()
3290 dateobj->time->sse_uptodate = 0; in php_date_modify()
3293 dateobj->time->y = tmp_time->y; in php_date_modify()
3296 dateobj->time->m = tmp_time->m; in php_date_modify()
3299 dateobj->time->d = tmp_time->d; in php_date_modify()
3303 dateobj->time->h = tmp_time->h; in php_date_modify()
3305 dateobj->time->i = tmp_time->i; in php_date_modify()
3307 dateobj->time->s = tmp_time->s; in php_date_modify()
3309 dateobj->time->s = 0; in php_date_modify()
3312 dateobj->time->i = 0; in php_date_modify()
3313 dateobj->time->s = 0; in php_date_modify()
3318 dateobj->time->us = tmp_time->us; in php_date_modify()
3328 timelib_set_timezone_from_offset(dateobj->time, 0); in php_date_modify()
3333 timelib_update_ts(dateobj->time, NULL); in php_date_modify()
3334 timelib_update_from_sse(dateobj->time); in php_date_modify()
3335 dateobj->time->have_relative = 0; in php_date_modify()
3336 memset(&dateobj->time->relative, 0, sizeof(dateobj->time->relative)); in php_date_modify()
3415 php_date_obj *dateobj; in php_date_add() local
3419 dateobj = Z_PHPDATE_P(object); in php_date_add()
3420 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_add()
3425 new_time = timelib_add_wall(dateobj->time, intobj->diff); in php_date_add()
3427 new_time = timelib_add(dateobj->time, intobj->diff); in php_date_add()
3429 timelib_time_dtor(dateobj->time); in php_date_add()
3430 dateobj->time = new_time; in php_date_add()
3467 php_date_obj *dateobj; in php_date_sub() local
3471 dateobj = Z_PHPDATE_P(object); in php_date_sub()
3472 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_sub()
3482 new_time = timelib_sub_wall(dateobj->time, intobj->diff); in php_date_sub()
3484 new_time = timelib_sub(dateobj->time, intobj->diff); in php_date_sub()
3486 timelib_time_dtor(dateobj->time); in php_date_sub()
3487 dateobj->time = new_time; in php_date_sub()
3574 php_date_obj *dateobj; in PHP_FUNCTION() local
3579 dateobj = Z_PHPDATE_P(object); in PHP_FUNCTION()
3580 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_FUNCTION()
3581 if (dateobj->time->is_localtime) { in PHP_FUNCTION()
3585 set_timezone_from_timelib_time(tzobj, dateobj->time); in PHP_FUNCTION()
3594 php_date_obj *dateobj; in php_date_timezone_set() local
3597 dateobj = Z_PHPDATE_P(object); in php_date_timezone_set()
3598 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_timezone_set()
3603 timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); in php_date_timezone_set()
3606 timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); in php_date_timezone_set()
3609 timelib_set_timezone(dateobj->time, tzobj->tzi.tz); in php_date_timezone_set()
3612 timelib_unixtime2local(dateobj->time, dateobj->time->sse); in php_date_timezone_set()
3653 php_date_obj *dateobj; in PHP_FUNCTION() local
3659 dateobj = Z_PHPDATE_P(object); in PHP_FUNCTION()
3660 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_FUNCTION()
3661 if (dateobj->time->is_localtime) { in PHP_FUNCTION()
3662 switch (dateobj->time->zone_type) { in PHP_FUNCTION()
3664 offset = timelib_get_time_zone_info(dateobj->time->sse, dateobj->time->tz_info); in PHP_FUNCTION()
3669 RETVAL_LONG(dateobj->time->z); in PHP_FUNCTION()
3672 RETVAL_LONG((dateobj->time->z + (3600 * dateobj->time->dst))); in PHP_FUNCTION()
3684 php_date_obj *dateobj; in php_date_time_set() local
3686 dateobj = Z_PHPDATE_P(object); in php_date_time_set()
3687 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_time_set()
3688 dateobj->time->h = h; in php_date_time_set()
3689 dateobj->time->i = i; in php_date_time_set()
3690 dateobj->time->s = s; in php_date_time_set()
3691 dateobj->time->us = ms; in php_date_time_set()
3692 timelib_update_ts(dateobj->time, NULL); in php_date_time_set()
3693 timelib_update_from_sse(dateobj->time); in php_date_time_set()
3736 php_date_obj *dateobj; in php_date_date_set() local
3738 dateobj = Z_PHPDATE_P(object); in php_date_date_set()
3739 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_date_set()
3740 dateobj->time->y = y; in php_date_date_set()
3741 dateobj->time->m = m; in php_date_date_set()
3742 dateobj->time->d = d; in php_date_date_set()
3743 timelib_update_ts(dateobj->time, NULL); in php_date_date_set()
3784 php_date_obj *dateobj; in php_date_isodate_set() local
3786 dateobj = Z_PHPDATE_P(object); in php_date_isodate_set()
3787 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_isodate_set()
3788 dateobj->time->y = y; in php_date_isodate_set()
3789 dateobj->time->m = 1; in php_date_isodate_set()
3790 dateobj->time->d = 1; in php_date_isodate_set()
3791 memset(&dateobj->time->relative, 0, sizeof(dateobj->time->relative)); in php_date_isodate_set()
3792 dateobj->time->relative.d = timelib_daynr_from_weeknr(y, w, d); in php_date_isodate_set()
3793 dateobj->time->have_relative = 1; in php_date_isodate_set()
3795 timelib_update_ts(dateobj->time, NULL); in php_date_isodate_set()
3837 php_date_obj *dateobj; in php_date_timestamp_set() local
3839 dateobj = Z_PHPDATE_P(object); in php_date_timestamp_set()
3840 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in php_date_timestamp_set()
3841 timelib_unixtime2local(dateobj->time, (timelib_sll)timestamp); in php_date_timestamp_set()
3842 timelib_update_ts(dateobj->time, NULL); in php_date_timestamp_set()
3843 php_date_set_time_fraction(dateobj->time, 0); in php_date_timestamp_set()
3884 php_date_obj *dateobj, *new_dateobj; in PHP_METHOD() local
3902 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3903 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_METHOD()
3918 php_date_obj *dateobj; in PHP_METHOD() local
3936 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3937 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_METHOD()
3938 php_date_set_time_fraction(dateobj->time, (int)us); in PHP_METHOD()
3948 php_date_obj *dateobj; in PHP_FUNCTION() local
3955 dateobj = Z_PHPDATE_P(object); in PHP_FUNCTION()
3956 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_FUNCTION()
3958 if (!dateobj->time->sse_uptodate) { in PHP_FUNCTION()
3959 timelib_update_ts(dateobj->time, NULL); in PHP_FUNCTION()
3962 timestamp = timelib_date_to_int(dateobj->time, &epoch_does_not_fit_in_zend_long); in PHP_FUNCTION()
3976 php_date_obj *dateobj; in PHP_METHOD() local
3981 dateobj = Z_PHPDATE_P(object); in PHP_METHOD()
3982 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(object)); in PHP_METHOD()
3984 RETURN_LONG((zend_long)dateobj->time->us); in PHP_METHOD()
4283 php_date_obj *dateobj; in PHP_FUNCTION() local
4291 dateobj = Z_PHPDATE_P(dateobject); in PHP_FUNCTION()
4292 DATE_CHECK_INITIALIZED(dateobj->time, Z_OBJCE_P(dateobject)); in PHP_FUNCTION()
4296 offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); in PHP_FUNCTION()
5177 php_date_obj *dateobj; in PHP_METHOD() local
5217 dateobj = Z_PHPDATE_P(start); in PHP_METHOD()
5219 memcpy(clone, dateobj->time, sizeof(timelib_time)); in PHP_METHOD()
5220 if (dateobj->time->tz_abbr) { in PHP_METHOD()
5221 clone->tz_abbr = timelib_strdup(dateobj->time->tz_abbr); in PHP_METHOD()
5223 if (dateobj->time->tz_info) { in PHP_METHOD()
5224 clone->tz_info = dateobj->time->tz_info; in PHP_METHOD()
5234 dateobj = Z_PHPDATE_P(end); in PHP_METHOD()
5235 clone = timelib_time_clone(dateobj->time); in PHP_METHOD()
5250 php_date_obj *dateobj; in PHP_METHOD() local
5258 dateobj = Z_PHPDATE_P(return_value); in PHP_METHOD()
5259 dateobj->time = timelib_time_ctor(); in PHP_METHOD()
5260 *dateobj->time = *dpobj->start; in PHP_METHOD()
5262 dateobj->time->tz_abbr = timelib_strdup(dpobj->start->tz_abbr); in PHP_METHOD()
5265 dateobj->time->tz_info = dpobj->start->tz_info; in PHP_METHOD()
5274 php_date_obj *dateobj; in PHP_METHOD() local
5285 dateobj = Z_PHPDATE_P(return_value); in PHP_METHOD()
5286 dateobj->time = timelib_time_ctor(); in PHP_METHOD()
5287 *dateobj->time = *dpobj->end; in PHP_METHOD()
5289 dateobj->time->tz_abbr = timelib_strdup(dpobj->end->tz_abbr); in PHP_METHOD()
5292 dateobj->time->tz_info = dpobj->end->tz_info; in PHP_METHOD()