def get_internaldate(date, received):
 if (date is None):
  (other, date) = received.split(';')
 parsed_date = parsedate_tz(date)
 timestamp = mktime_tz(parsed_date)
 dt = datetime.utcfromtimestamp(timestamp)
 return dt

def get_internaldate ( date , received ) : if ( date is None ) : ( other , date ) = received . split ( ';' ) parsed_date = parsedate_tz ( date ) timestamp = mktime_tz ( parsed_date ) dt = datetime . utcfromtimestamp ( timestamp ) return dt
get the date from the headers .