i want to convert date time in "2018-08-07T19:37:24+05:30" this pattern is it possible in android.?
Asked
Active
Viewed 192 times
-4
-
Duplicate of https://stackoverflow.com/questions/2735023/convert-string-to-java-util-date (except that question is not specifically android) – Eugene Styer Aug 07 '18 at 13:29
-
4Possible duplicate of [Converting ISO 8601-compliant String to java.util.Date](https://stackoverflow.com/questions/2201925/converting-iso-8601-compliant-string-to-java-util-date) – Henry Aug 07 '18 at 13:30
-
https://developer.android.com/reference/java/text/SimpleDateFormat – prashant17 Aug 07 '18 at 13:31
1 Answers
0
Try as follow
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-ddTHH:mm:ssK", Locale.getDefault());
dateFormat.format(Calendar.getInstance().getTime());
See more patterns here on y-gagar1n's GitHubGist

Abner Escócio
- 2,697
- 2
- 17
- 36