python-awips/dynamicserialize/adapters/FormattedDateAdapter.py

25 lines
590 B
Python
Raw Normal View History

2018-09-05 15:52:38 -06:00
#
# Adapter for FormattedDate
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 9/21/2015 4486 rjpeter Initial creation.
#
from dynamicserialize.dstypes.com.raytheon.uf.common.time import FormattedDate
ClassAdapter = 'com.raytheon.uf.common.time.FormattedDate'
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def serialize(context, date):
context.writeI64(date.getTime())
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def deserialize(context):
result = FormattedDate()
result.setTime(context.readI64())
2018-09-06 12:11:36 -06:00
return result