brick / date-time

Date and time library for PHP
MIT License
335 stars 30 forks source link

Named Constructors for TimeZone #54

Closed pscheit closed 2 years ago

pscheit commented 2 years ago

Would you be open to add some Named Constructors just for Convenience?

TimeZone::UTC() === TimeZone::parse('UTC') TimeZone::EuropeBerlin() === TimeZone::parse('Europe/Berlin')

etc, pp? That way i dont remember which string needs to be passed to parse

At least the on with UTC seems to be very handy?

pscheit commented 2 years ago

oooh. don't mind me, you added it, i didn't see because smallcaps

BenMorel commented 2 years ago

I think it makes sense for UTC as it is universally available, but other factory methods may depend on the version of the timezonedb, so I don't think we should hardcode them!