def datetime_to_timestamp(dt=None):
    """
    Create a StackDriver compatible timestamp.

    :param datetime.datetime dt: datetime object to convert.
    :rtype: six.string_types
    """
    return dt.isoformat('T') + 'Z' if dt else None
