| | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneOffset; |
| | | import java.time.*; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.TimeZone; |
| | |
| | | long endTimestamp = endDate.toInstant(ZoneOffset.of("+8")).toEpochMilli(); |
| | | return new Tuple(startTimestamp,endTimestamp); |
| | | } |
| | | |
| | | public static boolean isTimestampFromToday(long timestamp, ZoneId zoneId) { |
| | | Instant instant = Instant.ofEpochSecond(timestamp); |
| | | LocalDate timestampDate = instant.atZone(zoneId).toLocalDate(); |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | return timestampDate.isEqual(today); |
| | | } |
| | | } |