posix_now = time.time()
d = datetime.datetime.fromtimestamp(posix_now)
no_microseconds_time = time.mktime(d.timetuple())
has_microseconds_time = time.mktime(d.timetuple()) + d.microsecond * 1e-06
print(posix_now)
print(no_microseconds_time)
print(has_microseconds_time)
Converting datetime to POSIX time