Java 小知识 Posted on 11月 14, 201911月 14, 2019 by admin 1. Get client timezone Calendar.getInstance().getTimeZone() 2. JPA sql 输出 //queryType:TypedQuery System.out.println(queryType.unwrap(org.eclipse.persistence.jpa.JpaQuery.class).getDatabaseQuery().getSQLString()); 3. LocalDateTime to Date //local_time : LocalDateTime Date.from( local_time.atZone( ZoneId.systemDefault()).toInstant());