python-awips/dynamicserialize/adapters/TimestampAdapter.py

24 lines
533 B
Python
Raw Normal View History

2018-09-05 15:52:38 -06:00
#
# Adapter for java.sql.Timestamp
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 06/30/11 dgilling Initial Creation.
#
from dynamicserialize.dstypes.java.sql import Timestamp
ClassAdapter = 'java.sql.Timestamp'
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def serialize(context, timestamp):
context.writeI64(timestamp.getTime())
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def deserialize(context):
result = Timestamp(context.readI64())
2018-09-06 12:11:36 -06:00
return result