Skip to content

Commit

Permalink
Let testNowISO8601 test pass when Iso8601.nowISO8601() and Calendar.t…
Browse files Browse the repository at this point in the history
…ime return a different timestamp
  • Loading branch information
Federico Marin committed May 15, 2023
1 parent afe636e commit 68e39b5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ class Iso8601Test {
fun testNowISO8601() {
val df = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
df.timeZone = TimeZone.getTimeZone("UTC")
val expected = df.format(Calendar.getInstance().time)
val result = Iso8601.nowISO8601()
assertEquals(expected, result)
val nowIso8601 = Iso8601.nowISO8601()
val nowIso8601Millis = Iso8601.getISO8601TstampInMillis(nowIso8601)
val iso8601Date = Date(nowIso8601Millis)
val expected = df.format(iso8601Date)
assertEquals(expected, nowIso8601)
}

@Test
Expand Down

0 comments on commit 68e39b5

Please sign in to comment.