Created
April 10, 2011 13:40
-
-
Save charroch/912350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat | |
import java.util.Date | |
class RichHumanDate(d:Long) { | |
def toHumanString() = { | |
val sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS"); | |
val dt = new Date(d); | |
sdf.format(dt); | |
} | |
} | |
object RichHumanDate { | |
implicit def longToHumanReadable(d: Long) = new RichHumanDate(d) | |
} | |
import RichHumanDate._ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment