Search in sources :

Example 1 with GitDateFormatter

use of org.eclipse.jgit.util.GitDateFormatter in project gerrit by GerritCodeReview.

the class NoteDbUtil method formatTime.

public static String formatTime(PersonIdent ident, Timestamp t) {
    GitDateFormatter dateFormatter = new GitDateFormatter(Format.DEFAULT);
    // TODO(dborowitz): Use a ThreadLocal or use Joda.
    PersonIdent newIdent = new PersonIdent(ident, t);
    return dateFormatter.formatDate(newIdent);
}
Also used : PersonIdent(org.eclipse.jgit.lib.PersonIdent) GitDateFormatter(org.eclipse.jgit.util.GitDateFormatter)

Example 2 with GitDateFormatter

use of org.eclipse.jgit.util.GitDateFormatter in project gerrit by GerritCodeReview.

the class ChangeNoteUtil method formatTime.

public static String formatTime(PersonIdent ident, Timestamp t) {
    GitDateFormatter dateFormatter = new GitDateFormatter(Format.DEFAULT);
    // TODO(dborowitz): Use a ThreadLocal or use Joda.
    PersonIdent newIdent = new PersonIdent(ident, t);
    return dateFormatter.formatDate(newIdent);
}
Also used : PersonIdent(org.eclipse.jgit.lib.PersonIdent) GerritPersonIdent(com.google.gerrit.server.GerritPersonIdent) GitDateFormatter(org.eclipse.jgit.util.GitDateFormatter)

Aggregations

PersonIdent (org.eclipse.jgit.lib.PersonIdent)2 GitDateFormatter (org.eclipse.jgit.util.GitDateFormatter)2 GerritPersonIdent (com.google.gerrit.server.GerritPersonIdent)1