Created
August 27, 2014 11:53
-
-
Save thomasdarimont/8bcee8554bb5189be6f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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