1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

Don't try to work with negative timestamps

# It returns the same day as for 0, which is wrong
This commit is contained in:
Stanislav Malyshev
2000-10-30 16:13:03 +00:00
parent 1f7a3b3b11
commit 702b510dc6

View File

@@ -45,6 +45,10 @@ PHP_FUNCTION(unixtojd)
t = time(NULL);
}
if(t < 0) {
RETURN_FALSE;
}
ta = php_localtime_r(&t, &tmbuf);
jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday);