Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package de.tutorials.training;
import java.time.LocalDateTime;
public class SnapToCurrentTimeWindowExample {
public static void main(String[] args) {
LocalDateTime ldt = LocalDateTime.of(2013,9,1,13,39,0);
System.out.println(ldt);
// 2013-09-01T13:39
System.out.println(ldt.getHour() +":" + (ldt.getMinute() / 15) * 15);
//13:30
}
}
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.