On modern (3.x) python, to get RFC 3339 UTC time, all you need to do is use datetime and this single line (no third-party modules necessary):
import datetime
datetime.datetime.now(datetime.timezone.utc).isoformat()
The result is something like: '2019-06-13T15:29:28.972488+00:00'
This ISO 8601 string is also RFC3339 compatible.