我有几个日期的字符串:SimpleDateFormat的解析函数改变格式
[20-JUL-2012 5:11:36670 UTC PM,20-JUL-2012 5:11:36683 UTC PM]
ParsePosition parsePos = new ParsePosition(1);
SimpleDateFormat format2 = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss,SSS z a");
System.out.println(format2.parse(entry.getValue().toString(), parsePos)) ;
输出:Fri Jul 20 06:11:36 BST 2012
我需要的输出为20-Jul-2012 5:11:36,670 UTC PM
。
我是否需要在SimpleDateFormat
中设置LOCALE以使其不具有不同的输出?
possibl e [从String java提取日期]的副本(http://stackoverflow.com/questions/11599591/extract-date-from-string-java) – 2012-07-22 12:32:10
这是同一个问题吗?如果没有,请在这里编辑这一个,以清楚地区别于您的其他问题...或几天前您问过的问题:http://stackoverflow.com/questions/11507845/error-using-simpledateformat – 2012-07-22 12:32:59