[英]Converting adb shell date returned value to Date Object in Java
adb shell date returned Tue Feb 14 22:32:02 IST 2017 adb shell 日期返回 2 月 14 日星期二 22:32:02 IST 2017
I am trying to converting the "Tue Feb 14 22:32:02 IST 2017" to Date object in java.我正在尝试将“Tue Feb 14 22:32:02 IST 2017”转换为 Java 中的 Date 对象。 Can you please help in giving the sample snippet in Java to do the same.
您能否帮忙提供 Java 中的示例代码段来做同样的事情。 I tried with SimpleDateFormat to parse this string, but somehow getting parse exception.
我尝试使用 SimpleDateFormat 来解析这个字符串,但不知何故解析异常。
SimpleDateFormat formatter=new SimpleDateFormat("E, MMM dd yyyy HH:mm:ss");
Date d = formatter.parse(dateStart);
The formatting pattern must match the data.格式模式必须与数据匹配。 Yours is not a match.
你的不是比赛。
IST
.IST
添加时区符号。 Please search Stack Overflow before posting.发帖前请先搜索 Stack Overflow。 There are hundreds of examples you could have drawn from to solve your problem.
您可以借鉴数百个示例来解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.