I want to convert a UTC Time Date Time object to local time.
Here's a painstaking way to do this, which seems to work. But there must be a better way.
Here's the code (in Scala) with no surrounding declarations:
val dtUTC = new DateTime("2010-10-28T04:00") println("dtUTC = " + dtUTC) val dtLocal = timestampLocal(dtUTC) println("local = " + dtLocal) def timestampLocal(dtUTC: DateTime): String = {
Here's the conclusion:
dtUTC = 2010-10-28T04: 00: 00.000 + 11: 00 local = 2010-10-28T15: 00: 00.000 + 11: 00
scala time utc jodatime local
Koala3
source share