code: def testTimestampSerializeAndParse(self):
      message = timestamp_pb2.Timestamp()
      # Generated output should contain 3, 6, or 9 fractional digits.
      message.seconds = 0
      message.nanos = 0
      self.CheckTimestampConversion(message, "1970-01-01T00:00:00Z")
      message.nanos = 10000000
      self.CheckTimestampConversion(message, "1970-01-01T00:00:00.010Z")
      message.nanos = 10000
      self.CheckTimestampConversion(
          message, "1970-01-01T00:00:00.000010Z"
      )
      message.nanos = 10
      self.CheckTimestampConversion(
          message, "1970-01-01T00:00:00.000000010Z"
      )
      # Test min timestamps.
      message.seconds = -62135596800
      message.nanos = 0
      self.CheckTimestampConversion(message, "0001-01-01T00:00:00Z")
      # Test max timestamps.
      message.seconds = 253402300799
      message.nanos = 999999999
      self.CheckTimestampConversion(
          message, "9999-12-31T23:59:59.999999999Z"
      )
      # Test negative timestamps.
      message.seconds = -1
      self.CheckTimestampConversion(
          message, "1969-12-31T23:59:59.999999999Z"
      )
  
      # Parsing accepts an fractional digits as long as they fit into nano
      # precision.
      message.FromJsonString("1970-01-01T00:00:00.1Z")
      self.assertEqual(0, message.seconds)
      self.assertEqual(100000000, message.nanos)
      # Parsing accpets offsets.
      message.FromJsonString("1970-01-01T00:00:00-08:00")
      self.assertEqual(8 * 3600, message.seconds)
      self.assertEqual(0, message.nanos)
  
imports: from datetime import datetime
  from google.protobuf import any_pb2
  from google.protobuf import duration_pb2
  from google.protobuf import field_mask_pb2
  from google.protobuf import struct_pb2
  from google.protobuf import timestamp_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf.internal import any_test_pb2
  from google.protobuf.internal import test_util
  from google.protobuf.internal import well_known_types
  from google.protobuf import descriptor
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the TimeUtilTest obj's underlying member method code with example usage: obj.testTimestampSerializeAndParse() without return types