Class RelativeDateFormatter


  • public class RelativeDateFormatter
    extends Object
    Formatter to format timestamps relative to the current time using time units in the format defined by git log --relative-date.
    • Constructor Detail

      • RelativeDateFormatter

        public RelativeDateFormatter()
    • Method Detail

      • format

        public static String format​(Date when)
        Get age of given Date compared to now formatted in the same relative format as returned by git log --relative-date
        Parameters:
        when - Date to format
        Returns:
        age of given Date compared to now formatted in the same relative format as returned by git log --relative-date