We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3a8a408 + 2bea333 commit 68b2607Copy full SHA for 68b2607
modules/core/src-jvm/smithy4s/time/OffsetDateTimeCompanionPlatform.scala
@@ -34,5 +34,13 @@ private[time] trait OffsetDateTimeCompanionPlatform {
34
)
35
}
36
37
+ /** JVM platform only method */
38
+ def toJava(x: OffsetDateTime): JOffsetDateTime = {
39
+ val instant = java.time.Instant
40
+ .ofEpochSecond(x.timestamp.epochSecond, x.timestamp.nano.toLong)
41
+ val offset = java.time.ZoneOffset.ofTotalSeconds(x.offset.seconds)
42
+ java.time.OffsetDateTime.ofInstant(instant, offset)
43
+ }
44
+
45
def now(): OffsetDateTime = fromJava(JOffsetDateTime.now())
46
0 commit comments