code: def timestamp_from_dt(dt, epoch=datetime(1970, 1, 1)):
      
      delta = dt - epoch
      # return delta.total_seconds()
      return delta.seconds + delta.days * 86400
docs: Convert a datetime to a timestamp.
      https://stackoverflow.com/a/8778548/141395