code: def timestamp_from_datetime(dt):
      
      dt = dt.replace(tzinfo=utc)
      if hasattr(dt, "timestamp") and callable(dt.timestamp):
          return dt.replace(tzinfo=utc).timestamp()
      return (dt - datetime(1970, 1, 1, tzinfo=utc)).total_seconds()
docs: Given a datetime, in UTC, return a float that represents the timestamp for
      that datetime.
  
      http://stackoverflow.com/questions/8777753/converting-datetime-date-to-utc-timestamp-in-python#8778548