1

JGitで、コミットのタイムゾーンを取得するにはどうすればよいですか?現在のRevCommitクラスには、タイムゾーンに関する情報はありません。UTCUNIX時間のみを返します

4

1 に答える 1

2

PersonIdentを使用します。

RevCommit commit = ...;
PersonIdent committerIdent = commit.getCommitterIdent();
if (committerIdent != null) {
    TimeZone timeZone = committerIdent.getTimeZone(); // or getTimeZoneOffset()
}

getAuthorIdent()作者も同じです。

于 2012-06-28T22:01:47.150 に答える