Created
July 8, 2020 10:44
-
-
Save wpik/d4f4f365411a2ccb63b54f2ec860bdc1 to your computer and use it in GitHub Desktop.
Scala string interpolation for java.sql.Timestamp and java.sql.Date
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
implicit class StringTimeConversions(sc: StringContext) { | |
def t(args: Any*): Timestamp = | |
Timestamp.valueOf(sc.s(args: _*)) | |
def d(args: Any*): Date = | |
Date.valueOf(sc.s(args: _*)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment