def metar_to_iso8601(metardate):
    """Convert a metar date to an ISO8601 date."""
    if metardate is not None:
        date, hour = metardate.split()[:2]
        year, month, day = date.split('.')
        return '%s-%s-%s %s:%s:00Z' % (year, month, day, hour[:2], hour[2:4])
