(dateTime, convertToUTC=False)
return datestr
Ignore tzinfo unless convertToUTC.  Output string.
Ignore tzinfo unless convertToUTC.  Output string.
Ignore tzinfo unless convertToUTC . Output string .
def dateTimeToString(dateTime, convertToUTC=False):
    """
    Ignore tzinfo unless convertToUTC.  Output string.
    """
    if dateTime.tzinfo and convertToUTC:
        dateTime = dateTime.astimezone(utc)

    datestr = "{0}{1}{2}T{3}{4}{5}".format(
        numToDigits(dateTime.year, 4),
        numToDigits(dateTime.month, 2),
        numToDigits(dateTime.day, 2),
        numToDigits(dateTime.hour, 2),
        numToDigits(dateTime.minute, 2),
        numToDigits(dateTime.second, 2),
    )
    if tzinfo_eq(dateTime.tzinfo, utc):
        datestr += "Z"
    return datestr
def dateTimeToString ( dateTime , convertToUTC = False ) : if dateTime . tzinfo and convertToUTC : dateTime = dateTime . astimezone ( utc ) datestr = "{0}{1}{2}T{3}{4}{5}" . format ( numToDigits ( dateTime . year , 4 ) , numToDigits ( dateTime . month , 2 ) , numToDigits ( dateTime . day , 2 ) , numToDigits ( dateTime . hour , 2 ) , numToDigits ( dateTime . minute , 2 ) , numToDigits ( dateTime . second , 2 ) , ) if tzinfo_eq ( dateTime . tzinfo , utc ) : datestr += "Z" return datestr