Java ThaiBuddhistDate convert to LocalDate

Description

Java ThaiBuddhistDate convert to LocalDate

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();
  
    ThaiBuddhistDate thaiBuddhistNow2 = ThaiBuddhistDate.from(isoNow);
    LocalDate isoNow2 = LocalDate.from(thaiBuddhistNow);
    System.out.println("Thai  Buddhist Current Date  from  ISO:  "
        + thaiBuddhistNow2);//from   ww w. java 2 s . c om
    System.out.println("ISO  Current Date  from  Thai  Buddhist: " + isoNow2);

  }
}



PreviousNext

Related