def toString(tstamp):
# Break out the whole seconds into a GMT time
gmt = time.gmtime(tstamp.twsec)
# Append the fractional seconds down to microsecond precision
fractional = int(round(tstamp.tfsec * 1e6))
return '%04d:%02d:%02d::%02d:%02d:%02d.%06d' % (gmt.tm_year, gmt.tm_mon, gmt.tm_mday, gmt.tm_hour,
gmt.tm_min, gmt.tm_sec, fractional)
# Insert the arithmetic functions as operators on the PrecisionUTCTime class
评论列表
文章目录