| | |
| | | return getDayEndTime(cal.getTime()); |
| | | } |
| | | |
| | | public static String getDateStrOfUTCStr(String utcDate){ |
| | | ZonedDateTime utcTime = ZonedDateTime.parse(utcDate, |
| | | DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX").withZone(ZoneId.of("UTC"))); |
| | | // 转换为北京时间 |
| | | ZonedDateTime beijingTime = utcTime.withZoneSameInstant(ZoneId.of("Asia/Shanghai")); |
| | | return beijingTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | // 获取当天的开始时间 |
| | | public static java.util.Date getDayBegin() { |
| | | Calendar cal = new GregorianCalendar(); |