Skip Menu |

This queue is for tickets about the DateTime-Format-MySQL CPAN distribution.

Report information
The Basics
Id: 95526
Status: open
Priority: 0/
Queue: DateTime-Format-MySQL

People
Owner: Nobody in particular
Requestors: guenter [...] perlhipster.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Timezone needs to be an option
Quote: "Given a value of the appropriate type, this method will return a new DateTime object. The time zone for this object will always be the floating time zone, because by MySQL stores the local datetime, not UTC" This is fully true, but also this is only the default case. If you happen to have to develop a website with i18n you will most likely fall back to using UTC (also see: http://stackoverflow.com/a/19069310/567193) and converting the times inside perl itself. Therefor it would be nice to be able to passthrough a timezone like this: my $dt = DateTime::Format::MySQL->parse_datetime( '2003-01-16 23:12:01', 'UTC' ); which will default to floating. Would be glad to commit the changes. -- http://www.perlhipster.com
On 2014-05-10 11:23:12, PHIPSTER wrote: Show quoted text
> Therefor it would be nice to be able to passthrough a timezone like > this: > > my $dt = DateTime::Format::MySQL->parse_datetime( '2003-01-16 > 23:12:01', 'UTC' ); > > which will default to floating.
This change doesn't belong in one specific DateTime::Format::* class. What about all the rest? They need to have a consistent API. The right place for this is in DateTime::Format::Builder.