diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-09 23:11:06 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-09 23:11:06 -0800 |
commit | aaea4afbf3b47d623f396cb1eae247fa92053032 (patch) | |
tree | d462a508e545d5ec3637557b632cd0b7366e56cd /examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala | |
parent | 52306f10ce3d1e462b171688de04b37174c0b74a (diff) | |
download | hands-on-scala-js-aaea4afbf3b47d623f396cb1eae247fa92053032.tar.gz hands-on-scala-js-aaea4afbf3b47d623f396cb1eae247fa92053032.tar.bz2 hands-on-scala-js-aaea4afbf3b47d623f396cb1eae247fa92053032.zip |
.
Diffstat (limited to 'examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala')
-rw-r--r-- | examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala index e8e7a65..c5e8216 100644 --- a/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala +++ b/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala @@ -1,19 +1,20 @@ //jvm/src/main/scala/simple/Platform.scala package simple import java.text.SimpleDateFormat +import java.util.{TimeZone, Locale} object Platform{ def format(ts: Long) = { - val fmt = - "MMMM d, yyyy h:mm:ss aaa z" - new SimpleDateFormat(fmt).format( - new java.util.Date(ts) + val fmt = new SimpleDateFormat( + "yyyy-MM-dd'T'HH:mm:ss.sss'Z'" ) + fmt.setTimeZone(TimeZone.getTimeZone("UTC")) + fmt.format(new java.util.Date(ts)) } def main(args: Array[String]) = { val times = Seq( - System.currentTimeMillis(), - System.currentTimeMillis() + 1000 + 0L, + 1L << 32 ) println("Running on JVM! " + 1.0d) println(Simple.formatTimes(times)) |