Comment 1 for bug 1738737

Revision history for this message
jobrs (joachim-barheine) wrote :

monkey patch:

def patched_get_utc_now(timezone=None):
    """Return the current UTC time.

    :param timezone: an optional timezone param to offset time to.
    """
    utc_datetime = pytz.utc.localize(datetime.datetime.utcnow())
    if timezone is not None:
        try:
            utc_datetime = utc_datetime.astimezone(pytz.timezone(timezone))
        except Exception as e:
            _LOG.exception('Error translating timezones: %s ', e)

    return utc_datetime.isoformat()

# monkey patch pycadfs flawed timestamp formatter
pycadf.timestamp.get_utc_now = patched_get_utc_now