Skip to content

#4027 Fix mapping ZonedDateTime or OffsetDateTime to LocalDateTime#4047

Open
Takch02 wants to merge 3 commits into
mapstruct:mainfrom
Takch02:feature/4027-zoned-to-local-datetime
Open

#4027 Fix mapping ZonedDateTime or OffsetDateTime to LocalDateTime#4047
Takch02 wants to merge 3 commits into
mapstruct:mainfrom
Takch02:feature/4027-zoned-to-local-datetime

Conversation

@Takch02
Copy link
Copy Markdown

@Takch02 Takch02 commented May 3, 2026

Fixes #4027

Added implicit conversion support for:

  • ZonedDateTime → LocalDateTime (via toLocalDateTime())
  • OffsetDateTime → LocalDateTime (via toLocalDateTime())

Reverse mapping is intentionally not supported as it requires Zone/Offset information.

Changes:

  • Added JavaZonedDateTimeToLocalDateTimeConversion
  • Added JavaOffsetDateTimeToLocalDateTimeConversion
  • Added registerUnidirectional() in Conversions.java
  • Added ZonedOffsetDateTimeToLocalDateTimeConversionTest
  • Added fixture for SourceTargetMapperImpl

@Takch02
Copy link
Copy Markdown
Author

Takch02 commented May 3, 2026

@filiphr @JanecekPetr Please Review! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapping ZonedDateTime or OffsetDateTime to LocalDateTime

1 participant