Finding the transaction timestamp in ZODB
Hi there, Can enybody explain the format of the "byte serial" on the Data.fs? the FileStorage.py reads: "8 byte serial, type stamp that matches the transaction timestamp" When I u64() the read contents, I ger a string like this one (without the quotes): "230720283629242325L" I believe this reflects some sort of timestamp, but can't figure it out how to convert it to "readable" date/time value, anyone can help? Thanks in advance.
Can enybody explain the format of the "byte serial" on the Data.fs? the FileStorage.py reads: "8 byte serial, type stamp that matches the transaction timestamp"
from ZODB.TimeStamp import TimeStamp ts = apply(TimeStamp, _p_serial) t = ts.timeTime() Now t contains a floating point number in seconds since the epoch, like the return value from time.time(), which you can use with the functions in the time module or to construct a DateTime object. Hope this helps, -jfarr
participants (2)
-
Grakka -
Jonothan Farr