How to round a DateTime in MySQL?

前端 未结 6 1248
孤城傲影
孤城傲影 2020-12-21 17:48

I want to discretize the DateTime with the resolution of 5 minutes. I did it in C#, but how to convert the following code to MySQL?

DateTime Floor(DateTime d         


        
6条回答
  •  既然无缘
    2020-12-21 18:40

    You can look here. This example is a general case for rounding to the nearest X minutes, and is written in T-SQL, but the logic and the majority of the functions will be the same in both cases.

提交回复
热议问题