JS Utils Kit - v0.5.1
    Preparing search index...

    Function getMilliseconds

    • Converts a time duration (days, hours, minutes, seconds) into total milliseconds.

      Parameters

      • days: number = 0

        Number of days.

      • hours: Hour = 0

        Hour of the day (0–23).

      • minutes: MinuteOrSecond = 0

        Minute value (0–59).

      • seconds: MinuteOrSecond = 0

        Second value (0–59).

      Returns number

      The equivalent duration in milliseconds.

      Will throw an error if any parameter is negative.

      getMilliseconds(1);             // 86400000 (1 day)
      getMilliseconds(0, 1); // 3600000 (1 hour)
      getMilliseconds(0, 0, 30, 15); // 1815000 (30 minutes 15 seconds)