Class DurationUtils

java.lang.Object
com.ptc.projectmanagement.util.DurationUtils

public class DurationUtils extends Object


Supported API: true

Extendable: false
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    toMillis(double duration, DurationFormat durationFormat)


    Supported API: true Returns the duration in milliseconds based on the DurationFormat In other words, it converts the specified value to milliseconds based on the format which was passed in Use this method if you have a situation where you have one unit, but need the millisecond value.

    Methods inherited from class java.lang.Object

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

    • toMillis

      public static long toMillis(double duration, DurationFormat durationFormat) throws WTException


      Supported API: true Returns the duration in milliseconds based on the DurationFormat In other words, it converts the specified value to milliseconds based on the format which was passed in Use this method if you have a situation where you have one unit, but need the millisecond value. ie long millis = DurationUtils.getMillis(1.0, DurationFormat.MINUTES); // sets a duration of 1 minute (1 * 60 * 1000) long millis = DurationUtils.getMillis(3.0, DurationFormat.WEEKS); // returns the millisecond equivalent of 3 weeks
      Parameters:
      duration -
      durationFormat - the format in which duration is specified
      Throws:
      WTException