Commit fc42b45c authored by nyloth's avatar nyloth

[MOD] dates and timezones : Modify every call to php native date / timezone...

[MOD] dates and timezones : Modify every call to php native date / timezone functions in order to use GMT timezone instead of the server timezone.

Timestamps stored in the database should be stored in GMT timezone, because changing the server (or just its timezone settings) should never have an impact on tikiwiki. This is why every date(), strftime() and mktime() calls are replaced by gmdate(), gmstrftime() and gmmktime(). Those functions will use GMT timestamps and not a timestamp that depends on the server TZ environment variable.

!! Note that everything has not been fully tested yet and that this update lacks of an upgrade path for existing calendars and timezones stored in database with a server timezone.
parent 2d050dca
......@@ -65,7 +65,7 @@ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnec
* 3 message is appended to the file destination
*/
if (defined('ADODB_ERROR_LOG_TYPE')) {
$t = date('Y-m-d H:i:s');
$t = gmdate('Y-m-d H:i:s');
if (defined('ADODB_ERROR_LOG_DEST'))
error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
else
......
......@@ -133,7 +133,7 @@ function& adodb_log_sql(&$conn,$sql,$inputarr)
$conn->debug = 0;
$d = $conn->sysTimeStamp;
if (empty($d)) $d = date("'Y-m-d H:i:s'");
if (empty($d)) $d = gmdate("'Y-m-d H:i:s'");
if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {
$isql = "insert into $perf_table values($d,:b,:c,:d,:e,:f)";
} else if ($dbT == 'odbc_mssql' || $dbT == 'informix') {
......@@ -753,7 +753,7 @@ Committed_AS: 348732 kB
}
if ($cnt % 10 == 0) echo " Time ".$oslabel." Hit% Sess Reads/s Writes/s\n";
$cnt += 1;
echo date('H:i:s').' '.$osval."$hits $sess $reads $writes\n";
echo gmdate('H:i:s').' '.$osval."$hits $sess $reads $writes\n";
flush();
if (connection_aborted()) return;
......
......@@ -20,17 +20,17 @@ This library replaces native functions as follows:
<pre>
getdate() with adodb_getdate()
date() with adodb_date()
gmdate() with adodb_date()
gmdate() with adodb_gmdate()
mktime() with adodb_mktime()
gmmktime() with adodb_mktime()
gmmktime() with adodb_gmmktime()
strftime() with adodb_strftime()
strftime() with adodb_gmstrftime()
gmstrftime() with adodb_strftime()
gmstrftime() with adodb_gmstrftime()
</pre>
The parameters are identical, except that adodb_date() accepts a subset
of date()'s field formats. Mktime() will convert from local time to GMT,
and date() will convert from GMT to local time, but daylight savings is
of gmdate()'s field formats. Mktime() will convert from local time to GMT,
and gmdate() will convert from GMT to local time, but daylight savings is
not handled currently.
This library is independant of the rest of ADOdb, and can be used
......@@ -84,7 +84,7 @@ heuristic the first time adodb_getdate is called.
** FUNCTION adodb_date($fmt, $timestamp = false)
Convert a timestamp to a formatted local date. If $timestamp is not defined, the
current timestamp is used. Unlike the function date(), it supports dates
current timestamp is used. Unlike the function gmdate(), it supports dates
outside the 1901 to 2038 range.
The format fields that adodb_date supports:
......@@ -142,13 +142,13 @@ Same as adodb_date, but 2nd parameter accepts iso date, eg.
** FUNCTION adodb_gmdate($fmt, $timestamp = false)
Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the
current timestamp is used. Unlike the function date(), it supports dates
current timestamp is used. Unlike the function gmdate(), it supports dates
outside the 1901 to 2038 range.
** FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])
Converts a local date to a unix timestamp. Unlike the function mktime(), it supports
Converts a local date to a unix timestamp. Unlike the function gmmktime(), it supports
dates outside the 1901 to 2038 range. All parameters are optional.
......@@ -367,7 +367,7 @@ define('ADODB_DATE_VERSION',0.21);
glibc-2.2.5-34 and greater has been changed to return -1 for dates <
1970. This used to work. The problem exists with RedHat 7.3 and 8.0
echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
echo (gmmktime(0, 0, 0, 1, 1, 1960)); // prints -1
References:
http://bugs.php.net/bug.php?id=20048&edit=2
......@@ -389,7 +389,7 @@ function adodb_date_test_date($y1,$m,$d=13)
function adodb_date_test_strftime($fmt)
{
$s1 = strftime($fmt);
$s1 = gmstrftime($fmt);
$s2 = adodb_strftime($fmt);
if ($s1 == $s2) return true;
......@@ -417,7 +417,7 @@ function adodb_date_test()
adodb_date_test_strftime("%H %M S");
$t = adodb_mktime(0,0,0);
if (!(adodb_date('Y-m-d') == date('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'<br>';
if (!(adodb_date('Y-m-d') == gmdate('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'<br>';
$t = adodb_mktime(0,0,0,6,1,2102);
if (!(adodb_date('Y-m-d',$t) == '2102-06-01')) print 'Error in '.adodb_date('Y-m-d',$t).'<br>';
......@@ -472,16 +472,16 @@ function adodb_date_test()
// Test string formating
print "<p>Testing date formating</p>";
$fmt = '\d\a\t\e T Y-m-d H:i:s a A d D F g G h H i j l L m M n O \R\F\C822 r s t U w y Y z Z 2003';
$s1 = date($fmt,0);
$s1 = gmdate($fmt,0);
$s2 = adodb_date($fmt,0);
if ($s1 != $s2) {
print " date() 0 failed<br>$s1<br>$s2<br>";
print " gmdate() 0 failed<br>$s1<br>$s2<br>";
}
flush();
for ($i=100; --$i > 0; ) {
$ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000);
$s1 = date($fmt,$ts);
$s1 = gmdate($fmt,$ts);
$s2 = adodb_date($fmt,$ts);
//print "$s1 <br>$s2 <p>";
$pos = strcmp($s1,$s2);
......@@ -493,7 +493,7 @@ function adodb_date_test()
break;
}
}
print "<b>Error date(): $ts<br><pre>
print "<b>Error gmdate(): $ts<br><pre>
&nbsp; \"$s1\" (date len=".strlen($s1).")
&nbsp; \"$s2\" (adodb_date len=".strlen($s2).")</b></pre><br>";
$fail = true;
......@@ -629,7 +629,7 @@ function adodb_year_digit_check($y)
{
if ($y < 100) {
$yr = (integer) date("Y");
$yr = (integer) gmdate("Y");
$century = (integer) ($yr /100);
if ($yr%100 > 50) {
......@@ -656,7 +656,7 @@ function adodb_get_gmt_diff()
static $TZ;
if (isset($TZ)) return $TZ;
$TZ = mktime(0,0,0,1,2,1970,0) - gmmktime(0,0,0,1,2,1970,0);
$TZ = gmmktime(0,0,0,1,2,1970,0) - gmmktime(0,0,0,1,2,1970,0);
return $TZ;
}
......@@ -891,7 +891,7 @@ static $YRS;
'year' => $year,
'yday' => floor($secsInYear/$_day_power),
'weekday' => gmdate('l',$_day_power*(3+$dow)),
'month' => gmdate('F',mktime(0,0,0,$month,2,1971)),
'month' => gmdate('F',gmmktime(0,0,0,$month,2,1971)),
0 => $origd
);
}
......@@ -927,11 +927,11 @@ function adodb_date($fmt,$d=false,$is_gmt=false)
{
static $daylight;
if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
if ($d === false) return ($is_gmt)? @gmdate($fmt): @gmdate($fmt);
if (!defined('ADODB_TEST_DATES')) {
if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer
return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);
return ($is_gmt)? @gmdate($fmt,$d): @gmdate($fmt,$d);
}
}
......@@ -958,7 +958,7 @@ static $daylight;
*/
for ($i=0; $i < $max; $i++) {
switch($fmt[$i]) {
case 'T': $dates .= date('T');break;
case 'T': $dates .= gmdate('T');break;
// YEAR
case 'L': $dates .= $arr['leap'] ? '1' : '0'; break;
case 'r': // Thu, 21 Dec 2000 16:01:07 +0200
......@@ -966,7 +966,7 @@ static $daylight;
// 4.3.11 uses '04 Jun 2004'
// 4.3.8 uses ' 4 Jun 2004'
$dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', '
. ($day<10?'0'.$day:$day) . ' '.date('M',mktime(0,0,0,$month,2,1971)).' '.$year.' ';
. ($day<10?'0'.$day:$day) . ' '.gmdate('M',gmmktime(0,0,0,$month,2,1971)).' '.$year.' ';
if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour;
......@@ -983,8 +983,8 @@ static $daylight;
case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break;
case 'Q': $dates .= ($month+3)>>2; break;
case 'n': $dates .= $month; break;
case 'M': $dates .= date('M',mktime(0,0,0,$month,2,1971)); break;
case 'F': $dates .= date('F',mktime(0,0,0,$month,2,1971)); break;
case 'M': $dates .= gmdate('M',gmmktime(0,0,0,$month,2,1971)); break;
case 'F': $dates .= gmdate('F',gmmktime(0,0,0,$month,2,1971)); break;
// DAY
case 't': $dates .= $arr['ndays']; break;
case 'z': $dates .= $arr['yday']; break;
......@@ -1082,7 +1082,7 @@ function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=fa
if (!defined('ADODB_TEST_DATES')) {
if ($mon === false) {
return $is_gmt? @gmmktime($hr,$min,$sec): @mktime($hr,$min,$sec);
return $is_gmt? @gmmktime($hr,$min,$sec): @gmmktime($hr,$min,$sec);
}
// for windows, we don't check 1970 because with timezone differences,
......@@ -1092,7 +1092,7 @@ function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=fa
) {
return $is_gmt ?
@gmmktime($hr,$min,$sec,$mon,$day,$year):
@mktime($hr,$min,$sec,$mon,$day,$year);
@gmmktime($hr,$min,$sec,$mon,$day,$year);
}
}
......@@ -1193,7 +1193,7 @@ global $ADODB_DATE_LOCALE;
if (!defined('ADODB_TEST_DATES')) {
if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
if (!defined('ADODB_NO_NEGATIVE_TS') || $ts >= 0) // if windows, must be +ve integer
return ($is_gmt)? @gmstrftime($fmt,$ts): @strftime($fmt,$ts);
return ($is_gmt)? @gmstrftime($fmt,$ts): @gmstrftime($fmt,$ts);
}
}
......
......@@ -2206,7 +2206,7 @@
* Format database date based on user defined format.
*
* @param v is the character date in YYYY-MM-DD format, returned by database
* @param fmt is the format to apply to it, using date()
* @param fmt is the format to apply to it, using gmdate()
*
* @return a date formated as user desires
*/
......@@ -2228,7 +2228,7 @@
/**
*
* @param v is the character timestamp in YYYY-MM-DD hh:mm:ss format
* @param fmt is the format to apply to it, using date()
* @param fmt is the format to apply to it, using gmdate()
*
* @return a timestamp formated as user desires
*/
......@@ -2703,7 +2703,7 @@
/**
*
* @param v is the character timestamp in YYYY-MM-DD hh:mm:ss format
* @param fmt is the format to apply to it, using date()
* @param fmt is the format to apply to it, using gmdate()
*
* @return a timestamp formated as user desires
*/
......@@ -2720,7 +2720,7 @@
/**
* @param v is the character date in YYYY-MM-DD format, returned by database
* @param fmt is the format to apply to it, using date()
* @param fmt is the format to apply to it, using gmdate()
*
* @return a date formated as user desires
*/
......
......@@ -947,7 +947,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
$themth = $ADODB_mssql_mths[$themth];
if ($themth <= 0) return false;
// h-m-s-MM-DD-YY
return mktime(0,0,0,$themth,$theday,$rr[3]);
return gmmktime(0,0,0,$themth,$theday,$rr[3]);
}
function UnixTimeStamp($v)
......@@ -988,7 +988,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
break;
}
// h-m-s-MM-DD-YY
return mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
return gmmktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
}
}
......
......@@ -207,7 +207,7 @@ class ADODB_odbtp extends ADOConnection{
$this->databaseType = 'odbtp_vfp';
$this->fmtDate = "{^Y-m-d}";
$this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
$this->sysDate = 'date()';
$this->sysDate = 'gmdate()';
$this->sysTimeStamp = 'datetime()';
$this->ansiOuter = true;
$this->hasTop = 'top';
......
......@@ -39,8 +39,8 @@ class ADODB_sqlite extends ADOConnection {
function __get($name)
{
switch($name) {
case 'sysDate': return "'".date($this->fmtDate)."'";
case 'sysTimeStamp' : return "'".date($this->sysTimeStamp)."'";
case 'sysDate': return "'".gmdate($this->fmtDate)."'";
case 'sysTimeStamp' : return "'".gmdate($this->sysTimeStamp)."'";
}
}*/
......
......@@ -380,7 +380,7 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
$themth = $ADODB_sybase_mths[$themth];
if ($themth <= 0) return false;
// h-m-s-MM-DD-YY
return mktime(0,0,0,$themth,$rr[2],$rr[3]);
return gmmktime(0,0,0,$themth,$rr[2],$rr[3]);
}
function UnixTimeStamp($v)
......@@ -407,7 +407,7 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
break;
}
// h-m-s-MM-DD-YY
return mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]);
return gmmktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]);
}
}
?>
......@@ -29,7 +29,7 @@ class ADODB_vfp extends ADODB_odbc {
var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
var $sysTimeStamp = 'datetime()';
var $sysDate = 'date()';
var $sysDate = 'gmdate()';
var $ansiOuter = true;
var $hasTransactions = false;
var $curmode = false ; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
......
......@@ -100,7 +100,7 @@ foreach (glob('*.js') as $filename) {
// field attributes go here
array('style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
'name' => 'date1',
'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?>
'value' => gmstrftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?>
</td>
</tr>
</table>
......
......@@ -26,7 +26,7 @@
* @package Smarty
*/
/* $Id: Smarty_Compiler.class.php,v 1.11 2006-09-05 14:31:06 sylvieg Exp $ */
/* $Id: Smarty_Compiler.class.php,v 1.12 2007-02-03 20:47:34 nyloth Exp $ */
/**
* Template compiling class
......@@ -390,7 +390,7 @@ class Smarty_Compiler extends Smarty {
}
// put header at the top of the compiled template
$template_header = "<?php /* Smarty version ".$this->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
$template_header = "<?php /* Smarty version ".$this->_version.", created on ".gmstrftime("%Y-%m-%d %H:%M:%S")."\n";
$template_header .= " compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n";
/* Emit code to load needed plugins. */
......
......@@ -25,7 +25,7 @@ function smarty_core_write_compiled_include($params, &$smarty)
if (count($_match_source)==0) return;
// convert the matched php-code to functions
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".gmstrftime("%Y-%m-%d %H:%M:%S")."\n";
$_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
$_compile_path = $params['include_file_path'];
......
......@@ -40,7 +40,7 @@ function smarty_function_html_select_date($params, &$smarty)
require_once $smarty->_get_plugin_filepath('function','html_options');
/* Default values. */
$prefix = "Date_";
$start_year = strftime("%Y");
$start_year = gmstrftime("%Y");
$end_year = $start_year;
$display_days = true;
$display_months = true;
......@@ -132,14 +132,14 @@ function smarty_function_html_select_date($params, &$smarty)
}
if(preg_match('!^-\d+$!',$time)) {
// negative timestamp, use date()
$time = date('Y-m-d',$time);
// negative timestamp, use gmdate()
$time = gmdate('Y-m-d',$time);
}
// If $time is not in format yyyy-mm-dd
if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) {
// use smarty_make_timestamp to get an unix timestamp and
// strftime to make yyyy-mm-dd
$time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
$time = gmstrftime('%Y-%m-%d', smarty_make_timestamp($time));
}
// Now split this in pieces, which later can be used to set the select
$time = explode("-", $time);
......@@ -147,16 +147,16 @@ function smarty_function_html_select_date($params, &$smarty)
// make syntax "+N" or "-N" work with start_year and end_year
if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
if ($match[1] == '+') {
$end_year = strftime('%Y') + $match[2];
$end_year = gmstrftime('%Y') + $match[2];
} else {
$end_year = strftime('%Y') - $match[2];
$end_year = gmstrftime('%Y') - $match[2];
}
}
if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
if ($match[1] == '+') {
$start_year = strftime('%Y') + $match[2];
$start_year = gmstrftime('%Y') + $match[2];
} else {
$start_year = strftime('%Y') - $match[2];
$start_year = gmstrftime('%Y') - $match[2];
}
}
if (strlen($time[0]) > 0) {
......@@ -182,8 +182,8 @@ function smarty_function_html_select_date($params, &$smarty)
$month_values[''] = '';
}
for ($i = 1; $i <= 12; $i++) {
$month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
$month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
$month_names[$i] = gmstrftime($month_format, gmmktime(0, 0, 0, $i, 1, 2000));
$month_values[$i] = gmstrftime($month_value_format, gmmktime(0, 0, 0, $i, 1, 2000));
}
$month_result .= '<select name=';
......@@ -205,7 +205,7 @@ function smarty_function_html_select_date($params, &$smarty)
$month_result .= smarty_function_html_options(array('output' => $month_names,
'values' => $month_values,
'selected' => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
'selected' => (int)$time[1] ? gmstrftime($month_value_format, gmmktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
'print_result' => false),
$smarty);
$month_result .= '</select>';
......
......@@ -101,7 +101,7 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $hours,
'values' => $hours,
'selected' => strftime($hour_fmt, $time),
'selected' => gmstrftime($hour_fmt, $time),
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
......@@ -111,7 +111,7 @@ function smarty_function_html_select_time($params, &$smarty)
$all_minutes = range(0, 59);
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
$minutes[] = sprintf('%02d', $all_minutes[$i]);
$selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
$selected = intval(floor(gmstrftime('%M', $time) / $minute_interval) * $minute_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
......@@ -138,7 +138,7 @@ function smarty_function_html_select_time($params, &$smarty)
$all_seconds = range(0, 59);
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
$seconds[] = sprintf('%02d', $all_seconds[$i]);
$selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
$selected = intval(floor(gmstrftime('%S', $time) / $second_interval) * $second_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
......@@ -180,7 +180,7 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
'values' => array('am', 'pm'),
'selected' => strtolower(strftime('%p', $time)),
'selected' => strtolower(gmstrftime('%p', $time)),
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
......
......@@ -36,9 +36,9 @@ function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date
$format = str_replace($_win_from, $_win_to, $format);
}
if($string != '') {
return strftime($format, smarty_make_timestamp($string));
return gmstrftime($format, smarty_make_timestamp($string));
} elseif (isset($default_date) && $default_date != '') {
return strftime($format, smarty_make_timestamp($default_date));
return gmstrftime($format, smarty_make_timestamp($default_date));
} else {
return;
}
......
......@@ -22,7 +22,7 @@ function smarty_make_timestamp($string)
} elseif (preg_match('/^\d{14}$/', $string)) {
// it is mysql timestamp format of YYYYMMDDHHMMSS?
$time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
$time = gmmktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
} elseif (is_numeric($string)) {
......
......@@ -2,7 +2,7 @@
// $start_time = microtime(true);
// $Header: /cvsroot/tikiwiki/tiki/comments.php,v 1.68 2007-01-17 14:55:53 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/comments.php,v 1.69 2007-02-03 20:47:13 nyloth Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -305,7 +305,7 @@ if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'
if (!$isBuilt) {
$isBuilt = true;
$smarty->assign('mail_page', $_REQUEST["page"]);
$smarty->assign('mail_date', date("U"));
$smarty->assign('mail_date', gmdate("U"));
$smarty->assign('mail_user', $user);
$smarty->assign('mail_title', $_REQUEST["comments_title"]);
$smarty->assign('mail_comment', $_REQUEST["comments_data"]);
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/doc/devtools/ggg-trace.php,v 1.4 2005-05-18 10:59:14 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/doc/devtools/ggg-trace.php,v 1.5 2007-02-03 20:47:16 nyloth Exp $
//
// George G. Geller
// January 24, 2004
......@@ -31,9 +31,9 @@ class ggg_trace
$this->fp = fopen($nameStr,"a");
fwrite($this->fp,"\n");
// e.g. 20031231 17:00:20
fwrite($this->fp,"*".date("Ymd G:i:s")."*Starting*****************************************************\n");
fwrite($this->fp,"*".gmdate("Ymd G:i:s")."*Starting*****************************************************\n");
// print date("Ymd G:i:s<br>",time()); // e.g. 20031231 17:00:20
// print gmdate("Ymd G:i:s<br>",time()); // e.g. 20031231 17:00:20
}
function out($outStr="")
{
......@@ -73,7 +73,7 @@ class ggg_trace
}
function _ggg_trace()
{
fwrite($this->fp,"*".date("Ymd G:i:s")."*Finishing****************************************************\n");
fwrite($this->fp,"*".gmdate("Ymd G:i:s")."*Finishing****************************************************\n");
fclose($this->fp);
}
}
......
<?php // $Header: /cvsroot/tikiwiki/tiki/doc/devtools/parse_tiki.php,v 1.1 2006-12-22 04:29:22 mose Exp $
<?php // $Header: /cvsroot/tikiwiki/tiki/doc/devtools/parse_tiki.php,v 1.2 2007-02-03 20:47:16 nyloth Exp $
// heaviled modified get_strings.php
// dedicated as a tool for use in an eventual test suite
......@@ -58,7 +58,7 @@ function echoline($fd, $fx, $outstring, $style='', $mod='', $br=true) {
}
fwrite ($fd, $outstring.$br);
if ($mod == 'd') {
$outstring = date('D M d H:m:s Y',trim($outstring));
$outstring = gmdate('D M d H:m:s Y',trim($outstring));
}
if ($style == 'eob') {
$htmlstring = "</div>";
......
......@@ -5,7 +5,7 @@ include "/usr/local/tikiwiki/db/local.php";
$db = mysql_connect($host_tiki, $user_tiki, $pass_tiki);
mysql_select_db($dbs_tiki);
$pre = "usermap_". date("Y-m-d");
$pre = "usermap_". gmdate("Y-m-d");
$mif = "mif_$pre.mif";
$mid = "mif_$pre.mid";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.15 2006-09-05 15:35:30 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.16 2007-02-03 20:47:13 nyloth Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
# $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.15 2006-09-05 15:35:30 sylvieg Exp $
# $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.16 2007-02-03 20:47:13 nyloth Exp $
include_once ('tiki-setup.php');
include_once ('lib/drawings/drawlib.php');
......@@ -31,7 +31,7 @@ if (isset($_FILES['filepath']) && is_uploaded_file($_FILES['filepath']['tmp_name
$absolute_name = str_replace('.gif', '', $absolute_name);
$absolute_name = str_replace('.pad_xml', '', $absolute_name);
$now = date("U");
$now = gmdate("U");
if (substr($name,-4,4) == '.gif') {
$hash = $absolute_name . md5(uniqid('.')). '.gif';
......
......@@ -40,10 +40,10 @@ class Date_Calc
{
/**
* Returns the current local date. NOTE: This function
* retrieves the local date using strftime(), which may
* retrieves the local date using gmstrftime(), which may
* or may not be 32-bit safe on your system.
*
* @param string the strftime() format to return the date
* @param string the gmstrftime() format to return the date
*
* @access public
*
......@@ -52,7 +52,7 @@ class Date_Calc
function dateNow($format="%Y%m%d")
{
return(strftime($format,time()));
return(gmstrftime($format,time()));
} // end func dateNow
......@@ -1602,7 +1602,7 @@ class Date_Calc
function getMonthNames()
{
for($i=1;$i<13;$i++) {
$months[$i] = strftime('%B', mktime(0, 0, 0, $i, 1, 2001));
$months[$i] = gmstrftime('%B', gmmktime(0, 0, 0, $i, 1, 2001));
}
return($months);
} // end func getMonthNames
......@@ -1620,7 +1620,7 @@ class Date_Calc
function getWeekDays()
{
for($i=0;$i<7;$i++) {
$weekdays[$i] = strftime('%A', mktime(0, 0, 0, 1, $i, 2001));
$weekdays[$i] = gmstrftime('%A', gmmktime(0,