How to convert string to date object?

前端 未结 5 2163
不知归路
不知归路 2020-12-22 03:47
String date=\"2006-06-21T15:57:24.000Z\";

How do I convert this String to a Date object without changing this format in Android?

5条回答
  •  无人及你
    2020-12-22 04:36

    Use the Time class and parse the string. Then use the Time toMillis() function and instantiate a Date.

    http://developer.android.com/reference/android/text/format/Time.html#parse3339(java.lang.String)

提交回复
热议问题