def UnixToDHMS(duration):
    """
    Convert duration (in unix_timestamp seconds) to days, hours, minutes and 
        seconds.

    Args
        duration: <type 'int'> OR <type 'str'> Duration in seconds. 
            If given as a string, convert to integer.
    Returns
        d: days [0+]
        h: hours [0-23]
        m: minute [0-59]
        s: seconds [0-59]
    """
    duration = int(duration)
    d = duration / (24 * 60 * 60)
    h = duration / (60 * 60) % 24
    m = duration / 60 % 60
    s = duration % 60
    return d, h, m, s