Exemplo n.º 1
0
def encode_attribute_event_time(dt: datetime.datetime) -> str:
    ts = Timestamp()
    ts.FromDatetime(dt)
    return ts.ToJsonString()
Exemplo n.º 2
0
 def _proto_timestamp_to_pandas_time(
     timestamp: timestamp_pb2.Timestamp, ) -> pd.Timestamp:
     """Convert a protobuf Timestamp to a pandas Timestamp."""
     pts = pd.Timestamp(timestamp.ToJsonString())
     return TimeSeriesApi._convert_utc(pts)