Created
May 26, 2021 20:24
-
-
Save CharlesLuxinger/3af1f1b5e3f0b55e0bb1fae8eff8cfd6 to your computer and use it in GitHub Desktop.
OffsetDateTime Write Mongo Converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.soudonus.credit.port.config.converter | |
import java.time.OffsetDateTime | |
import java.util.Date | |
import org.springframework.core.convert.converter.Converter | |
import org.springframework.stereotype.Component | |
@Component | |
class OffsetDateTimeWriteConverter : Converter<OffsetDateTime, Date> { | |
override fun convert(offsetDateTime: OffsetDateTime): Date { | |
return Date.from(offsetDateTime.toInstant()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment