python-awips/dynamicserialize/adapters/TimestampAdapter.py

28 lines
543 B
Python
Raw Permalink Normal View History

2015-06-18 10:25:33 -06:00
##
##
#
# Adapter for java.sql.Timestamp
2016-03-16 16:32:17 -05:00
#
#
2015-06-18 10:25:33 -06:00
# SOFTWARE HISTORY
2016-03-16 16:32:17 -05:00
#
2015-06-18 10:25:33 -06:00
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 06/30/11 dgilling Initial Creation.
2016-03-16 16:32:17 -05:00
#
#
2015-06-18 10:25:33 -06:00
#
from dynamicserialize.dstypes.java.sql import Timestamp
ClassAdapter = 'java.sql.Timestamp'
def serialize(context, timestamp):
context.writeI64(timestamp.getTime())
2016-03-16 16:32:17 -05:00
2015-06-18 10:25:33 -06:00
def deserialize(context):
result = Timestamp(context.readI64())
return result