Skip to content

Instantly share code, notes, and snippets.

@suls
Last active January 15, 2016 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suls/124536c26c4a1fef447f to your computer and use it in GitHub Desktop.
Save suls/124536c26c4a1fef447f to your computer and use it in GitHub Desktop.
Is there a better way?
def toDateE(s: String) =
\/.fromTryCatchNonFatal {
new org.joda.DateTime(s)
}
def toDateO(s: String) =
toDateE(s).toOption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment