Perl: the Markov chain saw | |
PerlMonks |
Re^3: Lost in DateTime !by haukex (Archbishop) |
on Jun 13, 2017 at 21:50 UTC ( [id://1192743]=note: print w/replies, xml ) | Need Help?? |
I know that is was 23;55 Paris time. And I know that pgadmin displays 2017-06-10 21:55:00+02. Then it sounds to me like your time might be stored incorrectly in the DB. Personally I would try to track down the source of this error first, and fix it wherever the times are being put in the DB, and correcting the previously incorrectly stored times directly in the database if possible. Looking at the DateTime::Format::Pg docs, there are two methods, ->parse_timestamp_with_time_zone() suitable for columns of type TIMESTAMPTZ, and ->parse_timestamp_without_time_zone(), suitable for columns of type TIMESTAMP. Which do you have? Also, have a look at the "Limitations" section in the aforementioned docs - I don't know much about PostgreSQL, but it sounds to me like a discrepancy between the server time zone and your time zone might possibly also be to blame. I thnk that my input is 2017-06-10 21:55:00+02 Have you tried something like print "<<$row[1]>>\n"; to verify? From here: I have found a full DateTime solution : ... remove Paris time zone code, by converting to floating, set UTC time code, then convert by setting Paris time code. Sorry to be direct but this sounds like a hack that shouldn't be necessary if you correct the above issues. If you don't fix the problem at its source it will bite you elsewhere.
In Section
Seekers of Perl Wisdom
|
|