import logging


def time_difference(h1:int, m1:int, s1:int, h2:int, m2:int, s2:int=0) -> int:
    """
    Description:

        function get difference between 2 times times

    Arguments:

        h1 {int} : integer which contains the value of the current hour

        m1 {int} : integer which contains the value of the current minute

        s1 {int} : integer which contains the value of the current second

        h2 {int} : integer which contains the value of the update hour

        m2 {int} : integer which contains the value of the update minute

        s2 {int} : integer which contains the value of the update second. 0 by default.

    Returns:

        diff {int} : the difference in seconds between teh current time and the update time
    """
    # convert h1 : m1 : s1 into seconds
    t1 = h1 * 3600 + m1 * 60 + s1

    # convert h2 : m2 : s2 into seconds
    t2 = h2 * 3600 + m2 * 60 + s2

    if t1 == t2:
        logging.warning("UPDATE TIME IS NOW")
        return 0

    # calculating the difference in secs
    diff = t2-t1

    if diff < 0:
        # calculates difference in seconds if s2 is before s1
        diff = 60 * 60 * 24 + diff

    return diff