def get_datetime(epoch):
    '''
    get datetime from an epoch timestamp

    >>> get_datetime(1432188772)
    datetime.datetime(2015, 5, 21, 6, 12, 52)
    '''

    t = time.gmtime(epoch)
    dt = datetime.datetime(*t[:6])

    return dt
get datetime from an epoch timestamp

    >>> get_datetime(1432188772)
    datetime.datetime(2015, 5, 21, 6, 12, 52)