com.ibm.tivoli.maximo.skd.model

Class SKDDateUtility

  • java.lang.Object
    • com.ibm.tivoli.maximo.skd.model.SKDDateUtility
  • All Implemented Interfaces:
    java.io.Serializable


    public class SKDDateUtility
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SKDDateUtility() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.util.Date addDays(java.util.Locale l, java.util.TimeZone tz, java.util.Date date, int plusDays)
      Add a number of days to a date.
      static java.util.Date combineDateTime(java.util.Locale l, java.util.TimeZone tz, java.util.Date date, java.util.Date time)
      Combine fist Date's date and second Date's time and return a new date.
      static java.util.Date convertDateToServerTimezone(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Returns the date in timezone and locale
      static java.util.Date convertDateToUserTZ(java.util.Date d, java.util.Locale userLocale, java.util.TimeZone userTimeZone)
      Returns the date in user timezone and locale
      static java.util.Date findEndDate(java.util.Locale l, java.util.TimeZone tz, java.util.Date startDate, double duration)
      Get the end date for an activity giving start date and duration
      static java.util.Date findStartDate(java.util.Locale l, java.util.TimeZone tz, java.util.Date endDate, double duration)
      Get the start date for an activity giving end date and duration
      static java.util.Date getDateOnly(java.util.Date date)
      Get date without time Set time portion of passed date to 00:00:00
      static java.util.Date getDateOnly(java.util.Locale l, java.util.TimeZone tz, java.util.Date date)
      Get date without time Set time portion of passed date to 00:00:00
      static java.util.TreeMap getStartEndMap(java.util.Locale l, java.util.TimeZone tz, java.util.ArrayList mergedNonWorkPeriods)
      Get start and end date pair from merged non work periods
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SKDDateUtility

        public SKDDateUtility()
    • Method Detail

      • combineDateTime

        public static java.util.Date combineDateTime(java.util.Locale l,
                                                     java.util.TimeZone tz,
                                                     java.util.Date date,
                                                     java.util.Date time)
        Combine fist Date's date and second Date's time and return a new date.
        Parameters:
        locale -
        timezone -
        date -
        time -
        Returns:
        date
      • getDateOnly

        public static java.util.Date getDateOnly(java.util.Locale l,
                                                 java.util.TimeZone tz,
                                                 java.util.Date date)
        Get date without time Set time portion of passed date to 00:00:00
        Parameters:
        locale -
        timezone -
        date -
        Returns:
        The same as the input date, but with time set to 00:00:00
      • getDateOnly

        public static java.util.Date getDateOnly(java.util.Date date)
        Get date without time Set time portion of passed date to 00:00:00
        Parameters:
        date -
        Returns:
        The same as the input date, but with time set to 00:00:00
      • addDays

        public static java.util.Date addDays(java.util.Locale l,
                                             java.util.TimeZone tz,
                                             java.util.Date date,
                                             int plusDays)
        Add a number of days to a date. return the new date
        Parameters:
        locale -
        timezone -
        date -
        days - to add
        Returns:
        date
      • findEndDate

        public static java.util.Date findEndDate(java.util.Locale l,
                                                 java.util.TimeZone tz,
                                                 java.util.Date startDate,
                                                 double duration)
                                          throws java.lang.Exception
        Get the end date for an activity giving start date and duration
        Parameters:
        locale -
        timezone -
        startDate -
        duration -
        Returns:
        end date
        Throws:
        java.lang.Exception
      • findStartDate

        public static java.util.Date findStartDate(java.util.Locale l,
                                                   java.util.TimeZone tz,
                                                   java.util.Date endDate,
                                                   double duration)
                                            throws java.lang.Exception
        Get the start date for an activity giving end date and duration
        Parameters:
        locale -
        timezone -
        endDate -
        duration -
        Returns:
        start date
        Throws:
        java.lang.Exception
      • getStartEndMap

        public static java.util.TreeMap getStartEndMap(java.util.Locale l,
                                                       java.util.TimeZone tz,
                                                       java.util.ArrayList mergedNonWorkPeriods)
                                                throws java.lang.Exception
        Get start and end date pair from merged non work periods
        Parameters:
        locale -
        timezone -
        ArrayList - mergedNonWorkPeriods
        Returns:
        TreeMap
        Throws:
        java.lang.Exception
      • convertDateToServerTimezone

        public static java.util.Date convertDateToServerTimezone(java.util.Date d,
                                                                 java.util.Locale l,
                                                                 java.util.TimeZone tz)
        Returns the date in timezone and locale
        Parameters:
        l -
        tz -
        Returns:
        Date
        Throws:
        java.rmi.RemoteException
      • convertDateToUserTZ

        public static java.util.Date convertDateToUserTZ(java.util.Date d,
                                                         java.util.Locale userLocale,
                                                         java.util.TimeZone userTimeZone)
        Returns the date in user timezone and locale
        Parameters:
        l -
        tz -
        Returns:
        Date
        Throws:
        java.rmi.RemoteException