def __init__(self, initializer=None, age=None):
    super(RDFDatetime, self).__init__(None, age)

    if isinstance(initializer, RDFInteger):
      self._value = initializer._value  # pylint: disable=protected-access

    elif isinstance(initializer, (int, long, float)):
      self._value = int(initializer)

    elif isinstance(initializer, datetime.datetime):
      seconds = calendar.timegm(initializer.utctimetuple())
      self._value = (seconds * self.converter) + initializer.microsecond

    elif isinstance(initializer, basestring):
      try:
        # Can be just a serialized integer.
        self._value = int(initializer)
      except __HOLE__:
        if initializer:
          # Try to parse from human readable string.
          self.ParseFromHumanReadable(initializer)

    elif initializer is not None:
      raise InitializeError("Unknown initializer for RDFDateTime: %s." %
                            type(initializer))
dataset/ETHPy150Open google/grr/grr/lib/rdfvalue.py/RDFDatetime.__init__