def _timestring(t):
    """
    Returns a full string representation of a
    :class:`~obspy.core.utcdatetime.UTCDateTime` object, stripping away
    trailing decimal-second zeros.

    >>> from obspy import UTCDateTime
    >>> print(_timestring(UTCDateTime("2012-04-05T12:12:12.123456Z")))
    2012-04-05T12:12:12.123456
    >>> print(_timestring(UTCDateTime("2012-04-05T12:12:12.120000Z")))
    2012-04-05T12:12:12.12
    >>> print(_timestring(UTCDateTime("2012-04-05T12:12:12.000000Z")))
    2012-04-05T12:12:12
    >>> print(_timestring(UTCDateTime("2012-04-05T12:12:00.000000Z")))
    2012-04-05T12:12:00
    >>> print(_timestring(UTCDateTime("2012-04-05T12:12:00.120000Z")))
    2012-04-05T12:12:00.12
    """
    return str(t).rstrip("Z0").rstrip(".")