I have the following problem I need to convert some datetime object to time_ns (present in time)
all I can find is to convert the now datetime to that fixed nanoseconds number (i understand that it is calculated from a fixed date in 1970)
import time
now = time.time_ns()
all I want is to convert some normal datetime object to that fixed nanoseconds number
from datetime import datetime
x = datetime(2022, 2, 22, 15, 41, 50)
i don't want to be restricted to only now dates. is there some function in the library that does that? for the moment i cannot find anything
thank you very much