Function msToTimeString

  • Returns a TimeObject in string format.

    Parameters

    • msObject: TimeObject

      The TimeObject.

    • Optional simple: false

      Whether to return a simple string or a more detailed one.

    Returns string

    The converted string.

    Example

    // 2 days, 3 hrs, 4 mins, 5 secs
    msToTimeString({ d: 2, h: 3, m: 4, s: 5 })

    Example

    // MORE_THAN_A_DAY
    msToTimeString({ d: 2, h: 3, m: 4, s: 5 }, true)

    Example

    // 2:03:04
    msToTimeString({ d: 0, h: 2, m: 3, s: 4 }, true)

    Example

    // 3:04
    msToTimeString({ d: 0, h: 0, m: 3, s: 4 }, true)

    Example

    // 0:04
    msToTimeString({ d: 0, h: 0, m: 0, s: 4 }, true)
  • Parameters

    Returns string | "MORE_THAN_A_DAY"