Skip to content

Commit

Permalink
Fixing timezone offset to work off of the server's configured time zone.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarcher committed Jul 31, 2015
1 parent ffa7ba4 commit 9ccc951
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ public function listTableColumns($table, $database = null)
$sql = $this->_platform->getListTableColumnsSQL($table, $database);
$tableColumns = $this->_conn->fetchAll($sql);

// very temporary for examing result of test under Travis
if ($table == 'test_datetimetz_default_table') {
var_dump($sql);
var_dump($tableColumns);
}

return $this->_getPortableTableColumnList($table, $database, $tableColumns);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,11 @@ public function testDatetimeDefaultTimestamp()
*/
public function testDatetimeTzDefaultTimestamp()
{
$testTimestamp = '2014-08-29 18:01:01.370568-07';
// must determine server time zone for proper comparison
$serverTime = $this->_conn->fetchAssoc('SELECT CURRENT_TIMESTAMP AS timestamp_with_tz');
$timeZoneOffset = substr($serverTime['timestamp_with_tz'], -3);

$testTimestamp = '2014-08-29 18:01:01.370568' . $timeZoneOffset;

$table = new \Doctrine\DBAL\Schema\Table('test_datetimetz_default_table');

Expand Down

0 comments on commit 9ccc951

Please sign in to comment.