function date_adj_zone in Date 5
These functions will remove server timezone adjustment from timestamps needed because some php date functions automatically adjust to server zone but the date object uses raw values for date parts and does manual timezone adj needed for ability to accomodate timezones other than server zone
1 call to date_adj_zone()
- date_gmgetdate in ./
date.inc - We need a gmgetdate function, which does not exist because the getdate function creates an array where date parts and timestamp don't match getdate date parts are timezone-adjusted to the server zone and timestamp is not we need an array where…
File
- ./
date.inc, line 142 - Date/time API functions
Code
function date_adj_zone($timestamp) {
// No timezone adjustment for very old dates.
if ($timestamp < 86400) {
return $timestamp;
}
date_load_library();
switch (DATE_LIBRARY) {
case 'ADODB':
return intval($timestamp - adodb_date('Z', $timestamp));
default:
return intval($timestamp - date('Z', $timestamp));
}
}