'Construct a datetime from a POSIX timestamp (like time.time()).
A timezone info object may be passed in as well.'

@classmethod
def fromtimestamp(cls, t, tz=None):

    _check_tzinfo_arg(tz)
    converter = (_time.localtime if (tz is None) else _time.gmtime)
    (t, frac) = divmod(t, 1.0)
    us = int((frac * 1000000.0))
    if (us == 1000000):
        t += 1
        us = 0
    (y, m, d, hh, mm, ss, weekday, jday, dst) = converter(t)
    ss = min(ss, 59)
    result = cls(y, m, d, hh, mm, ss, us, tz)
    if (tz is not None):
        result = tz.fromutc(result)
    return result
