code: def testTimestampIntegerConversion(self):
      message = timestamp_pb2.Timestamp()
      message.FromNanoseconds(1)
      self.assertEqual(
          "1970-01-01T00:00:00.000000001Z", message.ToJsonString()
      )
      self.assertEqual(1, message.ToNanoseconds())
  
      message.FromNanoseconds(-1)
      self.assertEqual(
          "1969-12-31T23:59:59.999999999Z", message.ToJsonString()
      )
      self.assertEqual(-1, message.ToNanoseconds())
  
      message.FromMicroseconds(1)
      self.assertEqual(
          "1970-01-01T00:00:00.000001Z", message.ToJsonString()
      )
      self.assertEqual(1, message.ToMicroseconds())
  
      message.FromMicroseconds(-1)
      self.assertEqual(
          "1969-12-31T23:59:59.999999Z", message.ToJsonString()
      )
      self.assertEqual(-1, message.ToMicroseconds())
  
      message.FromMilliseconds(1)
      self.assertEqual(
          "1970-01-01T00:00:00.001Z", message.ToJsonString()
      )
      self.assertEqual(1, message.ToMilliseconds())
  
      message.FromMilliseconds(-1)
      self.assertEqual(
          "1969-12-31T23:59:59.999Z", message.ToJsonString()
      )
      self.assertEqual(-1, message.ToMilliseconds())
  
      message.FromSeconds(1)
      self.assertEqual("1970-01-01T00:00:01Z", message.ToJsonString())
      self.assertEqual(1, message.ToSeconds())
  
      message.FromSeconds(-1)
      self.assertEqual("1969-12-31T23:59:59Z", message.ToJsonString())
      self.assertEqual(-1, message.ToSeconds())
  
      message.FromNanoseconds(1999)
      self.assertEqual(1, message.ToMicroseconds())
      # For negative values, Timestamp will be rounded down.
      # For example, "1969-12-31T23:59:59.5Z" (i.e., -0.5s) rounded to seconds
      # will be "1969-12-31T23:59:59Z" (i.e., -1s) rather than
      # "1970-01-01T00:00:00Z" (i.e., 0s).
      message.FromNanoseconds(-1999)
      self.assertEqual(-2, message.ToMicroseconds())
  
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 3 for calling the TimeUtilTest obj's underlying member method code with example usage: obj.testTimestampIntegerConversion() without return types