Skip to content

Commit

Permalink
Partial revert 'Additional timezone init fixes'
Browse files Browse the repository at this point in the history
This reverts the changes to schema.php introduced by commit
b0d0c9d.

It is not necessary (and in fact, incorrect) to change timezone to UTC
prior to calling ADOConnection::BindTimestamp(), because ADOdb considers
the given timestamp to be local.

As a consequence, the timezone translation is applied twice, causing the
timestamp to be in the future.

A comment to explain this behavior has been added to the code, to avoid
this issue popping up again in the future.

Fixes #17980
  • Loading branch information
dregad committed Feb 3, 2015
1 parent 0a33bdf commit 53f1419
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions admin/schema.php
Expand Up @@ -50,11 +50,9 @@ function db_null_date() {
function installer_db_now() {
global $g_db;

$t_timezone = @date_default_timezone_get();
date_default_timezone_set( 'UTC' );
$t_time = $g_db->BindTimeStamp( time() );
@date_default_timezone_set( $t_timezone );
return $t_time;
# Timezone must not be set to UTC prior to calling BindTimestamp(), as
# ADOdb assumes a local timestamp and does the UTC conversion itself.
return $g_db->BindTimeStamp( time() );
}

# Special handling for Oracle (oci8):
Expand Down

0 comments on commit 53f1419

Please sign in to comment.