Skip to content

Introduce Date-to-Instant and Instant-to-Date converters #35175

@sbrannen

Description

@sbrannen

Overview

For #35156, we decided to register runtime hints for the java.sql.Timestamp.from(Instant) static factory method, since we want to avoid a direct dependency on optional java.sql types.

However, we can provide explicit support for java.util.Date.from(Instant) and the toInstant() instance methods in java.util.Date and its subtypes.

To achieve that, we should introduce an InstantToDateConverter and a DateToInstantConverter and register them automatically in DefaultConversionService.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions