#NEWLINE# def get_crash_datetime( self , as_utc = False ) : #NEWLINE# #INDENT# 'Returns a datetime.datetime object expressing the date and time of the\n        crash, if the crash has both of those attributes. If it does not, this\n        returns None.\n\n        Note, the original data has time in Pacific/Auckland timezone, which\n        means at daylight savings transition periods, the UTC time is\n        ambiguous for one hour. UTC time can be returned with the as_utc flag.\n        ' #NEWLINE# if ( ( self . crash_date != None ) and ( self . crash_time != None ) ) : #NEWLINE# #INDENT# local_dt = datetime . datetime . combine ( self . crash_date , self . crash_time ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( not as_utc ) : #NEWLINE# #INDENT# return local_dt #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return pytz . timezone ( 'Pacific/Auckland' ) . localize ( local_dt , is_dst = True ) . astimezone ( pytz . utc )