Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import java.time.LocalDateTime;
public class SnapToCurrentTimeWindowExample {
public static void main(String[] args) {
LocalDateTime ldt = LocalDateTime.of(2013,9,1,13,39,0);
// 2013-09-01T13:39
System.out.println(ldt.getHour() +":" + (ldt.getMinute() / 15) * 15);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.