日志(2个不同日期):解析Java的字符串到日期
START TIME BEFORE PARSE: 06/27/2012 09:00
START TIME AFTER PARSE : Thu Mar 06 09:00:00 EET 2014
START TIME BEFORE PARSE: 07/06/2012 09:00
START TIME AFTER PARSE : Thu Jun 07 09:00:00 EEST 2012
代码:
DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
Date date = sdf.parse(time);
System.out.println("TIME BEFORE PARSE: " + time);
System.out.println("TIME AFTER PARSE : " + date);
为什么它搞乱了一年?如何让它工作?
什么是'时间'? – Nishant 2012-07-10 06:59:01
@Nishant:即时消息登录日志 – Jaanus 2012-07-10 06:59:22
它确实搞乱了哪一年?你有这样的输出吗? – 2012-07-10 07:00:01