I'm looking to code a function that would truncate a timestamp received to the nearest previous 15 minutes interval. I.e. 01:16:58 -> 01:15:00, 01:02:32 - >01:00:00, 01:30:00 ->01:30:00 etc.
Any idea of a nice simple way of coding it?
We're on Java 8
Thanks
Update: Pls note that the truncation is required, not the rounding. This is how the question is different from the other one that has been mentioned by a number or readers. So, this is NOT a duplicate.