Last active
March 14, 2019 20:02
-
-
Save WesleyBatista/dcd0fd076c0ea1d013e25c8ed954bca2 to your computer and use it in GitHub Desktop.
convert timestamp to String in Scala
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 | |
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