Search code examples
javers

Override commit Date and Time in Javers


We are evaluating to use Javers for which we will be migrating audit data in to Javers from git .But we want keep the same commit Date and Time as it was in git , can we override commit data time and use the same date as earlier


Solution

  • Yes, use JaversBuilder.withDateTimeProvider​(DateProvider dateProvider). The Javadoc says:

    DateProvider providers current timestamp for Commit.getCommitDate(). By default, now() is used.