提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用泰国佛教和ISO历法
import java.time.LocalDate; import java.time.chrono.ThaiBuddhistDate; /*时 代 J a v a 公 众 号 - nowjava.com*/ public class Main { public static void main(String[] args) { ThaiBuddhistDate thaiBuddhistNow = ThaiBuddhistDate.now(); LocalDate isoNow = LocalDate.now(); System.out.println("Thai Buddhist Current Date: " + thaiBuddhistNow); System.out.println("ISO Current Date: " + isoNow); // Convert Thai Buddhist date to ISo date and vice-versa ThaiBuddhistDate thaiBuddhistNow2 = ThaiBuddhistDate.from(isoNow); LocalDate isoNow2 = LocalDate.from(thaiBuddhistNow); System.out.println(