ThaiBuddhistDate now(ZoneId) method in Java with Examples Last Updated : 20 May, 2020 Comments Improve Suggest changes Like Article Like Report The now() method of java.time.chrono.ThaiBuddhistDate class is used to get the current ThaiBuddhist date according to the ThaiBuddhist calendar system in the specified zone. Syntax: public static ThaiBuddhistDate now(ZoneId zone) Parameter: This method takes the object of zone id on the basis of which ThaiBuddhist date is going to be formed. Return Value: This method returns the current ThaiBuddhist date according to the ThaiBuddhist calendar system from the specified clock. Below are the examples to illustrate the now() method: Example 1: Java // Java program to demonstrate now() method import java.util.*; import java.io.*; import java.time.*; import java.time.chrono.*; import java.time.temporal.*; public class GFG { public static void main(String[] argv) { try { // Creating and initializing ZoneId ZoneId id = ZoneId.systemDefault(); // Creating and initializing // ThaiBuddhistDate Object ThaiBuddhistDate hidate = ThaiBuddhistDate.now(id); // Display the result System.out.println( "ThaiBuddhistDate: " + hidate); } catch (DateTimeException e) { System.out.println( "Passed parameter can" + " not form a date"); System.out.println( "Exception thrown: " + e); } } } Output: ThaiBuddhistDate: ThaiBuddhist BE 2563-05-08 Example 2: Java // Java program to demonstrate now() method import java.util.*; import java.io.*; import java.time.*; import java.time.chrono.*; import java.time.temporal.*; public class GFG { public static void main(String[] argv) { try { // Creating and initializing ZoneId ZoneId id = ZoneId.of("Z"); // Creating and initializing // ThaiBuddhistDate Object ThaiBuddhistDate hidate = ThaiBuddhistDate.now(id); // Display the result System.out.println( "ThaiBuddhistDate: " + hidate); } catch (DateTimeException e) { System.out.println( "passed parameter can" + " not form a date"); System.out.println( "Exception thrown: " + e); } } } Output: ThaiBuddhistDate: ThaiBuddhist BE 2563-05-08 Reference: https://docs.oracle.com/javase/9/docs/api/java/time/chrono/ThaiBuddhistDate.html#now-java.time.ZoneId- Comment More infoAdvertise with us Next Article MonthDay now(ZoneId) method in Java with Examples R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Java-Time-Chrono package Practice Tags : Java Similar Reads ThaiBuddhistDate now(Clock) method in Java with Example The now() method of java.time.chrono.ThaiBuddhistDate class is used to get the current ThaiBuddhist date according to the ThaiBuddhist calendar system from the specified clock. Syntax: public static ThaiBuddhistDate now(Clock clock) Parameter: This method takes the object of the clock on the basis o 2 min read ThaiBuddhistDate from() method in Java with Example The from() method of java.time.chrono.ThaiBuddhistDate class is used to get the ThaiBuddhist date according to the ThaiBuddhist calendar system for the particular temporal object. Syntax: public static ThaiBuddhistDate from(TemporalAccessor temporal) Parameter: This method takes the object of any te 2 min read MinguoDate now(ZoneId) method in Java with Examples The now() method of java.time.chrono.MinguoDate class is used to get the current Minguo date according to the Minguo calendar system in the specified zone. Syntax: public static MinguoDate now(ZoneId zone) Parameter: This method takes the object of zone id on the basis of which Minguo date is going 2 min read MonthDay now(ZoneId) method in Java with Examples The now(ZoneId zone) method of the MonthDay class in Java is used to get the current month-day from the system clock in the specified time-zone. Syntax: public static MonthDay now(ZoneId zone) Parameters: This method accepts ZoneId as parameter. Return value: This method returns the current month-da 1 min read ThaiBuddhistChronology dateNow(ZoneId) method in Java with Example The dateNow() method of java.time.chrono.ThaiBuddhistChronology class is used get the current ThaiBuddhist according to ThaiBuddhist calendar system from the system clock in the specified time zone. Syntax: public ThaiBuddhistDate dateNow(ZoneId zone) Parameter: This method takes the object of zone 2 min read ZonedDateTime ofInstant() method in Java with Examples In ZonedDateTime class, there are two types of ofInstant() method depending upon the parameters passed to it. ofInstant(Instant instant, ZoneId zone) ofInstant() method of an ZonedDateTime class used to create an instance of ZonedDateTime from an Instant and zoneId passed as parameter to this method 3 min read Like