X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe-android/blobdiff_plain/04a5abaece151705e9bd7026653f79938a7a2fbc..a5ec891a1f3cbe4ae9aad5d2252f39b483ed543e:/util.scala diff --git a/util.scala b/util.scala index ea776e7..8ede691 100644 --- a/util.scala +++ b/util.scala @@ -36,6 +36,7 @@ import java.nio.{ByteBuffer, CharBuffer}; import java.nio.channels.{SelectionKey, Selector}; import java.nio.channels.spi.{AbstractSelector, AbstractSelectableChannel}; import java.nio.charset.Charset; +import java.text.SimpleDateFormat; import java.util.{Set => JSet}; import java.util.concurrent.locks.{Lock, ReentrantLock}; @@ -561,7 +562,9 @@ def oxford(conj: String, things: Seq[String]): String = things match { sb.result } -def formatTime(t: Int): String = +val datefmt = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + +def formatDuration(t: Int): String = if (t < -1) "???" else { val (s, t1) = (t%60, t/60);