"""Date Utility.""" from datetime import datetime def get_timestamp_utc_iso8601(): """Get a UTC ISO8601 timestamp with microsecond precision. Not adding a timezone indicator of Z at the end, because mysql will truncate it and issue truncation warnings Example output: 2016-02-29T22:29:03.165772 Returns: timestamp (str): current timestamp """ return datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%f')