I have the following code:
import datetime
from datetime import datetime as dt
def ceil_dt(dt, delta):
return dt + (dt.min - dt) % delta
NextInterval5m = ceil_dt(now, timedelta(minutes=5))
unixtime5m = dt.fromtimestamp(NextInterval5m)
The problem is that i keep getting the following error:
TypeError: an integer is required (got type datetime.datetime)
Can someone help me out on this? I don't understand to what i am supposed to convert NextInterval5m in order to make it work. I'm trying to convert NextInterval5m to an Unix timestamp
ceil_dt?