ref #34 time formatting and precision time access
This commit is contained in:
1 parent
732d8f3877
commit
230cb0a067
8 files changed
+108
-14
No files matched your search
@@ -2560,4 +2560,18 @@ class ScriptTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testInstantFormatting() = runTest {
|
||||
eval(
|
||||
"""
|
||||
import lyng.time
|
||||
val now = Instant()
|
||||
val unixEpoch = "%ts"(now)
|
||||
println("current seconds is %s"(unixEpoch))
|
||||
println("current time is %tT"(now))
|
||||
assertEquals( unixEpoch.toInt(), now.epochSeconds.toInt() )
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user