Checks if both times are still the same day. @param millis1 The first time in milliseconds. @param millis2 The second time in milliseconds. @return if both times are still the same day.
(long millis1, long millis2)
| 309 | * @return if both times are still the same day. |
| 310 | */ |
| 311 | public static boolean isSameDay(long millis1, long millis2) { |
| 312 | Date dateTime1 = new Date(millis1); |
| 313 | Date dateTime2 = new Date(millis2); |
| 314 | Calendar calendar1 = Calendar.getInstance(); |
| 315 | calendar1.setTime(dateTime1); |
| 316 | Calendar calendar2 = Calendar.getInstance(); |
| 317 | calendar2.setTime(dateTime2); |
| 318 | return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar1.get(Calendar.DAY_OF_YEAR) == calendar2.get(Calendar.DAY_OF_YEAR); |
| 319 | } |
| 320 | |
| 321 | /** |
| 322 | * Creates a String in HH:MM:SS-Format for showing time. |
no test coverage detected