def calculate_time(time_sec):
    """convert time in secs to days hours minutes and seconds"""
    days = time_sec // (3600 * 24)
    hours = time_sec % (3600 * 24) // 3600
    minutes = time_sec % 3600 // 60
    seconds = time_sec % 60
    return ('{} days {} hours {} minutes {} seconds'.format(int(days),int(hours),int(minutes),int(seconds)))