Java 8 – MinguoDate examples
This MinguoDate calendar system is primarily used in Taiwan (Republic of China…). To convert the current date to the Minguo date, just subtracts the current year with number 1911
Favourite tutorials for developers
This MinguoDate calendar system is primarily used in Taiwan (Republic of China…). To convert the current date to the Minguo date, just subtracts the current year with number 1911
If Java 8, DateTimeFormatter, else SimpleDateFormat to change the date format in a String. Convert the String to LocalDateTime and change the date format with DateTimeFormatter. Convert the String to…
In Java, we can use Timestamp.valueOf(LocalDateTime) to convert a LocalDateTime into a Timestamp. Java example to convert java.time.LocalDateTime to java.sql.Timestamp and vice verse.
Java example to convert java.time.ZonedDateTime to java.sql.Timestamp and vice verse. 1. ZonedDateTime -> Timestamp TimeExample1.java Output 2. Timestamp -> ZonedDateTime TimeExample2.java Output Download Source Code $ git clone https://github.com/favtuts/java-core-tutorials-examples $…
An example of converting a String to LocalDateTime, but it prompts the following errors: Unable to obtain LocalDateTime from TemporalAccessor: {},ISO resolved to 2020-08-31 of type java.time.format.Parsed . The date…
This example shows you how to parse a date (02 Jan) without a year specified. The pattern dd MMM is not enough; we need a DateTimeFormatterBuilder to provide a default…
In Java 8, we can use ChronoUnit.DAYS.between(from, to) to calculate days between two dates, for both LocalDate and LocalDateTime.
In Java 8, we can use Instant.ofEpochMilli().atZone() to convert the epoch time in milliseconds back to LocalDate or LocalDateTime
Ramadan is the 9th month of the Islamic calendar, the entire month.
In Java 8, you can use the predefined java.time.temporal.TemporalAdjusters to adjust a date or Temporal. Example to move a date to firstDayOfMonth, firstDayOfNextMonth, next Monday and etc. Example to implement…