Skip to content

Instantly share code, notes, and snippets.

@WesleyBatista
Last active March 14, 2019 20:02
Show Gist options
  • Save WesleyBatista/dcd0fd076c0ea1d013e25c8ed954bca2 to your computer and use it in GitHub Desktop.
Save WesleyBatista/dcd0fd076c0ea1d013e25c8ed954bca2 to your computer and use it in GitHub Desktop.
convert timestamp to String in Scala
import java.text.SimpleDateFormat
object TS2Date4 {
def convert():String = {
val ts = System.currentTimeMillis()
val df:SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
df.format(ts)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment