#include #include #include #include namespace NProtoInterop { google::protobuf::Duration CastToProto(TDuration duration) { return google::protobuf::util::TimeUtil::MicrosecondsToDuration(duration.MicroSeconds()); } google::protobuf::Timestamp CastToProto(TInstant instant) { return google::protobuf::util::TimeUtil::MicrosecondsToTimestamp(instant.MicroSeconds()); } TDuration CastFromProto(const google::protobuf::Duration& duration) { return TDuration::MicroSeconds(google::protobuf::util::TimeUtil::DurationToMicroseconds(duration)); } TInstant CastFromProto(const google::protobuf::Timestamp& timestamp) { return TInstant::MicroSeconds(google::protobuf::util::TimeUtil::TimestampToMicroseconds(timestamp)); } }