def parse_w3c_date(meta_name, string):
    """Parse datetimes as defined by the W3C.

    See https://www.w3.org/TR/NOTE-datetime

    """
    if W3C_DATE_RE.match(string):
        return string
    else:
        LOGGER.warning(
            'Invalid date in <meta name="%s"> %r', meta_name, string)
Parse datetimes as defined by the W3C.

See https://www.w3.org/TR/NOTE-datetime
weasyprint/html.py