-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed as not planned
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Consider autoconfiguring a default java.time.Clock
instance.
I was very surprised to see that there is currently is no autoconfigured Clock
instance. I know it's only four lines of code in our application, and yet - every modern application will have them, and therefore Spring Boot can come in rescue:
@Bean
public Clock clock() {
return Clock.systemDefaultZone();
}
I suppose this was not done because there may be people who want Clock.systemUTC()
instead? Indeed, I see that, but with the exception of JEP 400 the JDK is very consistent in using the default timezone/locale etc., e.g. in ZonedDateTime.now()
and all its friends.
I strongly believe the above autoconfiguration would positively please and spoil developers without taking risks. It's a small convenience, that's it.
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply