Java LocalDate convert to ThaiBuddhistDate

Description

Java LocalDate convert to ThaiBuddhistDate

import java.time.LocalDate;
import java.time.chrono.ThaiBuddhistDate;

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);

    ThaiBuddhistDate thaiBuddhistNow2 = ThaiBuddhistDate.from(isoNow);
    System.out.println(thaiBuddhistNow2);
  }//  w ww  .j  a  v  a2  s .  co  m
}



PreviousNext

Related