diff options
| author | Mark Newnham <mark@newnhams.com> | 2020-01-06 19:33:19 -0700 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2020-01-24 23:08:40 +0100 |
| commit | 787b1c2bc5efa02adca2a93c2c81f4162cde46e9 (patch) | |
| tree | 05cd06a3ba144a2e797c957479258509c9c58f65 /adodb-time.inc.php | |
| parent | b9942e03efa1e6edc3518773badfe2800120891a (diff) | |
| download | adodb-787b1c2bc5efa02adca2a93c2c81f4162cde46e9.tar.gz adodb-787b1c2bc5efa02adca2a93c2c81f4162cde46e9.tar.bz2 adodb-787b1c2bc5efa02adca2a93c2c81f4162cde46e9.zip | |
Remove test for ADODB_DATETIME_CLASS
The PHP date object was only available for PHP > 5.0. The code tested
for version in order to use the class.
Diffstat (limited to 'adodb-time.inc.php')
| -rw-r--r-- | adodb-time.inc.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/adodb-time.inc.php b/adodb-time.inc.php index 1d4d25d6..97d2829e 100644 --- a/adodb-time.inc.php +++ b/adodb-time.inc.php @@ -404,8 +404,6 @@ First implementation. */ define('ADODB_DATE_VERSION',0.35); -$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2); - /* This code was originally for windows. But apparently this problem happens also with Linux, RH 7.3 and later! @@ -737,13 +735,12 @@ function adodb_get_gmt_diff_ts($ts) */ function adodb_get_gmt_diff($y,$m,$d) { -static $TZ,$tzo; -global $ADODB_DATETIME_CLASS; + static $TZ,$tzo; if (!defined('ADODB_TEST_DATES')) $y = false; else if ($y < 1970 || $y >= 2038) $y = false; - if ($ADODB_DATETIME_CLASS && $y !== false) { + if ($y !== false) { $dt = new DateTime(); $dt->setISODate($y,$m,$d); if (empty($tzo)) { @@ -1081,9 +1078,8 @@ function adodb_date2($fmt, $d=false, $is_gmt=false) */ function adodb_date($fmt,$d=false,$is_gmt=false) { -static $daylight; -global $ADODB_DATETIME_CLASS; -static $jan1_1971; + static $daylight; + static $jan1_1971; if (!isset($daylight)) { $daylight = function_exists('adodb_daylight_sv'); @@ -1135,12 +1131,9 @@ static $jan1_1971; $dates .= date('e'); break; case 'T': - if ($ADODB_DATETIME_CLASS) { - $dt = new DateTime(); - $dt->SetDate($year,$month,$day); - $dates .= $dt->Format('T'); - } else - $dates .= date('T'); + $dt = new DateTime(); + $dt->SetDate($year,$month,$day); + $dates .= $dt->Format('T'); break; // YEAR case 'L': $dates .= $arr['leap'] ? '1' : '0'; break; |
