Function formatTimeBR

  • Format Date object to Brazil time format HH:MM:SS

    Parameters

    • date: Date
    • seconds: boolean = false

    Returns string

    Example

    // returns '12:12'
    formatTimeBR(new Date(2012, 11, 12, 12, 12, 12))
    // returns '12:12:12'
    formatTimeBR(new Date(2012, 11, 12, 12, 12, 12), true)