diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-02 04:57:37 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-02 04:57:37 -0800 |
commit | a33254276bd211bf33be86eeb871ddbfe36fdb47 (patch) | |
tree | b257d473be4fa110f7846f372ea94fc6714dad90 /examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala | |
parent | d00a2e25a9ee527fa39feb04c3137715501e9fda (diff) | |
download | hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.tar.gz hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.tar.bz2 hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.zip |
Moved `examples` into `examples/demos`, sketched out a simple example cross-module
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 | 23 |
1 files changed, 23 insertions, 0 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 new file mode 100644 index 0000000..af70429 --- /dev/null +++ b/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala @@ -0,0 +1,23 @@ +/*jvm/src/main/scala/simple/Platform.scala*/ +package simple +import java.text.SimpleDateFormat + +object Platform{ + def format(ts: Long) = { + // http://docs.oracle.com/javase/7/ + // docs/api/java/text/SimpleDateFormat.html + val fmt = "MMMM d, yyyy h:mm:ss aaa z" + new SimpleDateFormat(fmt).format( + new java.util.Date(ts) + ) + } + def main(args: Array[String]) = { + println("simple.jvm") + val times = Seq( + System.currentTimeMillis(), + System.currentTimeMillis() + 1000, + System.currentTimeMillis() + 2000 + ) + println(Simple.formatTimestamps(times)) + } +}
\ No newline at end of file |