Class DateUtil

java.lang.Object
org.alfresco.util.DateUtil

public class DateUtil extends Object
A utility class for working with dates.
Author:
Jamal Kaabi-Mofrad
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    calculateDays(long startMs, long endMs)
    Calculate the number of days between start and end dates based on the default timezone.
    static int
    calculateMs(long startMs, long endMs)
    Calculate the number of milliseconds between start and end dates based on the default timezone.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • calculateDays

      public static int calculateDays(long startMs, long endMs)
      Calculate the number of days between start and end dates based on the default timezone. If the end date is before the start date, the returned value is negative.
      Parameters:
      startMs - start date in milliseconds
      endMs - end date in milliseconds
      Returns:
      number days between
    • calculateMs

      public static int calculateMs(long startMs, long endMs)
      Calculate the number of milliseconds between start and end dates based on the default timezone. If the end date is before the start date, the returned value is negative.
      Parameters:
      startMs - start date in milliseconds
      endMs - end date in milliseconds
      Returns:
      number milliseconds between