Skip to content

Instantly share code, notes, and snippets.

@bertrandmartel
Created August 9, 2015 14:04
Show Gist options
  • Save bertrandmartel/9446d3a322e9f29efd93 to your computer and use it in GitHub Desktop.
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)
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);
}
@smmcneill
Copy link

This won't compile, will it?

@chaocharleswang
Copy link

return xxx for void?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment