List of usage examples for org.eclipse.jgit.util GitDateParser parse
public static Date parse(String dateStr, Calendar now) throws ParseException
From source file:com.google.gitiles.DateFormatterTest.java
License:Open Source License
private PersonIdent newIdent(String whenStr, String tzStr) throws ParseException { whenStr += " " + tzStr; Date when = GitDateParser.parse(whenStr, null); TimeZone tz = getTimeZone("GMT" + tzStr); PersonIdent ident = new PersonIdent("A User", "user@example.com", when, tz); // PersonIdent.toString() uses its own format with "d" instead of "dd", // hence the mismatches in 2 vs. 02 above. Nonetheless I think this sanity // check is useful enough to keep around. assertEquals("PersonIdent[A User, user@example.com, " + whenStr + "]", ident.toString()); return ident; }