Skip to content

Commit

Permalink
TH-58: Forenkler funksjonsdefinisjon
Browse files Browse the repository at this point in the history
  • Loading branch information
kvstrant committed Sep 20, 2024
1 parent d01e1a6 commit 78b3b79
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import javax.xml.datatype.DatatypeFactory

private val datatypeFactory by lazy { DatatypeFactory.newDefaultInstance() }

fun timestampUtc(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0): Timestamp {
val timestamp = Timestamp()
timestamp.timestamp = datatypeFactory.newXMLGregorianCalendar(year, month, day, hour, minute, second, 0, 0)
return timestamp
fun timestampUtc(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0) = Timestamp().apply {
this.timestamp = datatypeFactory.newXMLGregorianCalendar(year, month, day, hour, minute, second, 0, 0)
}

0 comments on commit 78b3b79

Please sign in to comment.