schema_wrapper_utils.cc 413 B

123456789101112131415
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #include "schema_wrapper_utils.h"
  3. void set_google_timestamp_from_timeval(struct timeval tv, google::protobuf::Timestamp *ts)
  4. {
  5. ts->set_nanos(tv.tv_usec*1000);
  6. ts->set_seconds(tv.tv_sec);
  7. }
  8. void set_timeval_from_google_timestamp(const google::protobuf::Timestamp &ts, struct timeval *tv)
  9. {
  10. tv->tv_sec = ts.seconds();
  11. tv->tv_usec = ts.nanos()/1000;
  12. }