Python | From DateTime to timestamp - then back from timestamp to DateTime

12 views
Skip to first unread message

David Tayar

unread,
Aug 7, 2019, 3:25:07 AM8/7/19
to Protocol Buffers
Hi,
I'm using protobuf in client-server method.
In that way the client send massage to function in the server, the massage include time stamp.
So, the client massage is look like that (evtmgr is the massage name):
evtmgr.time.FromDatetime(event.TimeGenerated)

In the proto:
google.protobuf.Timestamp time = 2;

In the server side:
loghand.time = datetime.fromtimestamp(evtmgr.time.seconds)

loghand.time - need to get DateTime, but the hour/minutes isn't correct. ( Only the Date is OK).
What I'm doing wrong ?
Reply all
Reply to author
Forward
0 new messages