def FromString(cls, value, tz=None):
    """Create a Timestamp from a string.

    Args:
      value: String interval or datetime.
          e.g. "2013-01-05 13:00:00" or "1d"
      tz: optional timezone, if timezone is omitted from timestring.

    Returns:
      A new Timestamp.

    Raises:
      TimeParseError if unable to parse value.
    """
    result = cls._StringToTime(value, tz=tz)
    if result:
      return result

    result = cls._IntStringToInterval(value)
    if result:
      return cls.utcnow() - result

    raise TimeParseError(value)