thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

Does thriftrw-node return timestamps as string #158

Closed dswho closed 6 years ago

dswho commented 6 years ago

I know that for timestamps in thrift, the notation is

typedef i64 (js.type = "Date") Timestamp

Does thriftrw-node return an actual date or is this converted to a string?

I'm trying to figure out the correct flow annotation for Timestamp is, because when my node backend get a thrift response back from a golang backend I am seeing it as a string, but the flow annotation for timestamps is Date in thrift2flow

https://github.com/uber-node/thrift2flow/issues/15

kriskowal commented 6 years ago

js.type=Date indicates that the encoded representation is a number of milliseconds since the Unix Epoch, and the JavaScript representation is a Date object. ThriftRW will also coerce an ISO string on the writer side.