相关疑难解决方法(0)

Java String to DateTime

I have a string from a json response:

start: "2013-09-18T20:40:00+0000",
end: "2013-09-18T21:39:00+0000",
Run Code Online (Sandbox Code Playgroud)

How do i convert this string to a java DateTime Object?

i have tried using the following:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
start = sdf.parse("2013-09-18T20:40:00+0000");
Run Code Online (Sandbox Code Playgroud)

but with this i can only create a Date Object. But the time binded in the String is kinda essential.

Any Help is greatly appreciated!

java datetime

8
推荐指数
2
解决办法
5万
查看次数

标签 统计

datetime ×1

java ×1