Skip to content

Instantly share code, notes, and snippets.

@MJ111
Created June 19, 2018 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MJ111/f46670a0e50dbd219511db6d9d308ddf to your computer and use it in GitHub Desktop.
Save MJ111/f46670a0e50dbd219511db6d9d308ddf to your computer and use it in GitHub Desktop.
get_utc_iso_format.py
def get_iso_format():
"""
this returns utc iso8601 string. for example: '2018-06-19T08:51:56+00:00'
"""
import datetime
return datetime.datetime.now(tz=datetime.timezone.utc).replace(microsecond=0).isoformat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment