How to get a serie of five minute for each minute in an hour?

17 Views Asked by At

This is an application on programming but it nature is a simple arithmetic progression

I need to update a database at each 5 min interval, if is 13:03 I want it to fill 13:00 in database, if is 13:06 -> 13:05, always rounding down to five multiple. The way that I got to do this is date = date.replace(minutes=(date.minutes/5)*5 which seems silly to me, like if I'm missing something

I thought that this would make sense

$\frac{m}5 5 \Rightarrow \frac{5m}5 \Rightarrow m$

But $m$ is any number $[0..59]$ while $\frac{m}5 5$ is always a multiple of 5 between $[0..59]$ so I cannot simplify $\frac{m}5 5$ and expect to get a multiple of 5

What I'm missing?