1

I am using node, I am curious why proto buffer there is no date data type?

I am using sequelizejs ORM which I define a date field:

tranTime: DataTypes.DATE

MYSQL database is save as DateTime.

Which data type should I use? Anyone use datetime with GRPC?

Alvin
  • 8,219
  • 25
  • 96
  • 177
  • There's a Date (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) in place, and there's a 3rd party ORM utility (https://github.com/dresende/node-orm2) in place as well. I believe you can use Date in your program while can be properly mapped to real dbms field type. – tibetty Aug 10 '17 at 03:53
  • 1
    I am talking about protocol buffer. https://developers.google.com/protocol-buffers/ – Alvin Aug 10 '17 at 05:10

1 Answers1

5

I use an int64 unix timestamp and then convert it. Date formats can be different between languages but a unix timestamp would be the same as an int64 or unsigned int32

Trevor V
  • 1,958
  • 13
  • 33