database icon indicating copy to clipboard operation
database copied to clipboard

ResultSet->normalizeRow ignores timezones

Open lookyman opened this issue 11 years ago • 1 comments

https://github.com/nette/database/blob/4b4a269d2b92d8fc922230996889128948a5e346/src/Database/ResultSet.php#L167

Tested for PostgreSQL's timestamp with time zone data type. This line seems to throw out timezone, when it is present. 2014-10-27 18:05:00 +0100 gets converted to 2014-10-27 18:05:00 with timezone specified in config date.timezone.

Something like $row[$key] = Nette\Utils\DateTime::from(strtotime($value)); works, but is not very nice. I would like to know if a) this is a bug or I am doing something wrong, and b) possible solutions?

lookyman avatar Oct 27 '14 17:10 lookyman

Timestamp with timezone is not covered by test. U guess, noone used it.

One possible solution is fixing normalization :)

milo avatar Oct 28 '14 21:10 milo