diff options
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 40a0c96d61..2b28bed9a5 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -85,6 +85,22 @@ PHP_MINFO_FUNCTION(date) php_info_print_table_end(); } +signed long php_parse_date(char *string, signed long *now) +{ + timelib_time *parsed_time; + int error; + signed long retval; + + parsed_time = timelib_strtotime(string); + timelib_update_ts(parsed_time, NULL); + retval = timelib_date_to_int(parsed_time, &error); + timelib_time_dtor(parsed_time); + if (error) { + return -1; + } + return retval; +} + static char* guess_timezone(TSRMLS_D) { char *env; |