日誌(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