Created
August 9, 2015 14:04
-
-
Save bertrandmartel/9446d3a322e9f29efd93 to your computer and use it in GitHub Desktop.
[ JAVA ] convert String timestamp in RFC 3339 format to date object (only from JAVA 7)
This file contains hidden or 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; | |
private void convertRfc3339ToDate(String timestamp) | |
{ | |
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").parse(dateStr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This won't compile, will it?