Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use 4-digit date so dates > 2009 are handled correctly.

  • Loading branch information...
commit 2be6daa542f54f25ea228dd21aab5c7ec21ef688 1 parent 4583de5
Craig Forster authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/main/java/hudson/plugins/cmvc/util/DateUtil.java
View
5 src/main/java/hudson/plugins/cmvc/util/DateUtil.java
@@ -14,7 +14,7 @@
public class DateUtil {
/** Date format expected by CMVC */
- private static final String CMVC_DATE_FORMAT_INOUT = "yy/MM/dd HH:mm:ss";
+ private static final String CMVC_DATE_FORMAT_INOUT = "yyyy/MM/dd HH:mm:ss";
private static final SimpleDateFormat SDF = new SimpleDateFormat(CMVC_DATE_FORMAT_INOUT);
/** A working calendar. */
@@ -59,8 +59,7 @@ public static Date convertFromCmvcDate(String cmvcDate) throws ParseException {
public static String convertToCmvcDate(Date lastBuild) {
if (lastBuild != null) {
CALENDAR.setTime(lastBuild);
- String sufix = CALENDAR.get(Calendar.YEAR) < 2000 ? "0" : "1";
- return "'" + sufix + SDF.format(lastBuild) + "'";
+ return "'" + SDF.format( lastBuild ) + "'";
}
return null;
}
Please sign in to comment.
Something went wrong with that request. Please try again.