Skip to content

Commit

Permalink
lit
Browse files Browse the repository at this point in the history
  • Loading branch information
kellen committed Aug 22, 2024
1 parent d2386c9 commit 23fceb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/src/main/scala/magnolify/shared/Time.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object Time {
// micros /////////////////////////////////////////////////////
@inline def microsToInstant(microsFromEpoch: Long): Instant = {
val epochSeconds = TimeUnit.MICROSECONDS.toSeconds(microsFromEpoch)
val nanoAdjustment = TimeUnit.MICROSECONDS.toNanos(microsFromEpoch % 1_000_000L)
val nanoAdjustment = TimeUnit.MICROSECONDS.toNanos(microsFromEpoch % 1000000L)
Instant.ofEpochSecond(epochSeconds, nanoAdjustment)
}
@inline def microsFromInstant(instant: Instant): Long = {
Expand Down Expand Up @@ -114,7 +114,7 @@ object Time {
// nanos /////////////////////////////////////////////////////
// Long does not technically have enough range for Instant
@inline def nanosToInstant(epochNanos: Long): Instant =
Instant.ofEpochSecond(TimeUnit.NANOSECONDS.toSeconds(epochNanos), epochNanos % 1_000_000_000L)
Instant.ofEpochSecond(TimeUnit.NANOSECONDS.toSeconds(epochNanos), epochNanos % 1000000000L)

Check warning on line 117 in shared/src/main/scala/magnolify/shared/Time.scala

View check run for this annotation

Codecov / codecov/patch

shared/src/main/scala/magnolify/shared/Time.scala#L117

Added line #L117 was not covered by tests
@inline def nanosFromInstant(instant: Instant): Long =
TimeUnit.SECONDS.toNanos(instant.getEpochSecond) + instant.getNano

Check warning on line 119 in shared/src/main/scala/magnolify/shared/Time.scala

View check run for this annotation

Codecov / codecov/patch

shared/src/main/scala/magnolify/shared/Time.scala#L119

Added line #L119 was not covered by tests
@inline def nanosToJodaInstant(nanosFromEpoch: Long): joda.Instant =
Expand Down

0 comments on commit 23fceb8

Please sign in to comment.