convertir datetime to timestamp django

from datetime import datetime

Assuming you have a datetime object called "my_datetime"

my_datetime = datetime(2022, 10, 31, 12, 0, 0)

Converting datetime to timestamp

my_timestamp = my_datetime.timestamp()

The variable "my_timestamp" now holds the UNIX timestamp of the given datetime

print(my_timestamp)