Closed kagmole closed 4 years ago
Hi, thanks for your suggestion. I'm uncomfortable with having a default timezone, as people will start using it without thinking about it twice, and this will lead to bugs as soon as the default is changed.
I've always found it much more solid to manually provide the timezone, and it always made sense to provide it wherever I used now()
.
NB: The only thing that has a default value is the Clock
, as it would be very cumbersome to have to provide your own. Timezone? It's always good to provide it explicitly, and I feel like this is an advantage of this library over PHP's DateTime
, which is affected by the default timezone, and can have the same code produce different outputs on different platforms.
Make the
TimeZone
parameter optional in the following static factory methods:LocalDate::now(..)
LocalTime::now(..)
LocalDateTime::now(..)
ZonedDateTime::now(..)
If no time zone is provided, the default one is used. Say:
If the proposal is accepted, I can write the changes.