问题描述
- joda匹配英文月份出错
-
以下是我匹配的时间,大神们,看看有什么问题:
propweties文件18/Jun/2013 16:07:02 +0800
time_format_4 = dd/MMM/yyyy HH:mm:ss Z
代码:
DateTimeParser[] dateParsers = new DateTimeParser[getLength()+1];
Long timeStemp = null;
int i = 0;while (true) { String time_format = pc.get("time_format_" + i); System.out.println(time_format); if (time_format == null) break; dateParsers[i] = DateTimeFormat.forPattern(time_format).getParser(); i++; } DateTimeFormatter formatter = new DateTimeFormatterBuilder().append( null, dateParsers).toFormatter(); DateTime date = formatter.parseDateTime(time); timeStemp = date.toDate().getTime(); return timeStemp; }
时间: 2025-01-30 17:22:38