[removed] Round Time UP nearest 5 minutes

前端 未结 6 1211
悲&欢浪女
悲&欢浪女 2021-01-06 21:59

I need to be able to round time to the next nearest 5 minutes.

Time now 11:54 - clock is 11:55

Time now 11:56 - clock is 12:00

<
6条回答
  •  囚心锁ツ
    2021-01-06 22:22

    Add 2.5 minutes to your time, then round.

    11:54 + 2.5 = 11:56:30 -> 11:55
    11:56 + 2.5 = 11:58:30 -> 12:00
    

提交回复
热议问题