def isotime(at=None, subsecond=False):
 if (not at):
  at = utcnow()
 st = at.strftime((_ISO8601_TIME_FORMAT if (not subsecond) else _ISO8601_TIME_FORMAT_SUBSECOND))
 tz = (at.tzinfo.tzname(None) if at.tzinfo else 'UTC')
 st += ('Z' if (tz == 'UTC') else tz)
 return st

def isotime ( at = None , subsecond = False ) : if ( not at ) : at = utcnow ( ) st = at . strftime ( ( _ISO8601_TIME_FORMAT if ( not subsecond ) else _ISO8601_TIME_FORMAT_SUBSECOND ) ) tz = ( at . tzinfo . tzname ( None ) if at . tzinfo else 'UTC' ) st += ( 'Z' if ( tz == 'UTC' ) else tz ) return st
stringify utc time in iso 8601 format .