Created
January 29, 2011 13:05
-
-
Save NIA/801810 to your computer and use it in GitHub Desktop.
parsing JSON data to Calendar
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
| private static final String dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"; // 2011-01-29T00:02:08+06:00 | |
| public static Calendar parseDate(String strDate) throws ParseException { | |
| SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.US); | |
| Calendar cal = Calendar.getInstance(); | |
| cal.setTime(sdf.parse(strDate)); | |
| return cal; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment