def millis_to_srt(millis):
    """Convert milliseconds time to the SRT subtitles format time string."""
    result = ''
    # milliseconds
    milliseconds = millis % 1000
    result = ('%03d' % milliseconds) + result
    millis = (millis - milliseconds) / 1000
    # seconds
    seconds = millis % 60
    result = ('%02d,' % seconds) + result
    millis = (millis - seconds) / 60
    # minutes
    minutes = millis % 60
    result = ('%02d:' % minutes) + result
    millis = (millis - minutes) / 60
    # hours
    result = ('%02d:' % millis) + result
    # ready
    return result