summaryrefslogtreecommitdiff
path: root/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala
diff options
context:
space:
mode:
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.scala23
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