Get First and Last Day of Week, Month or Year in Java
Learn to use Java 8 LocalDate and TemporalAdjusters class to get the first and the last day of the current week, month or year with examples.
Learn to use Java 8 LocalDate and TemporalAdjusters class to get the first and the last day of the current week, month or year with examples.
Learn to get the Month information in either number or name, and to convert it into another using Java Date-time API and simple examples.
Learn to convert a specified Instant (in UTC) to ZonedDateTime (at some zone), and ZonedDateTime to Instant with easy-to-follow Java examples.
Learn to convert from LocalDate to ZonedDateTime and from ZonedDateTime to LocalDate in Java 8. As we know, LocalDate represents a calendar date without the time and the zone information. ZonedDateTime instance contains all three information i.e. date, time and zone. ZonedDateTime = LocalDate + time + timezone 1. LocalDate …
Learn to convert from LocalDate to LocalDateTime and from LocalDateTime to LocalDate in Java 8.
Java 8 examples to convert from LocalDate to java.sql.Date and vice versa.
Java examples to convert from LocalTime to java.sql.Time and vice versa.
Learn to convert from java.time.LocalDate to java.util.Date and vice-versa using the easy-to-understand Java examples. 1. Convert Date to LocalDate The Date.getTime() method returns the epoch milliseconds i.e. the number of milliseconds since January 1, 1970, 00:00:00 GMT. To get the LocalDate, we need to first set the zone offset information …
Java 8 example to convert Date to LocalDateTime. Also, learn to convert LocalDateTime to Date instance to use in legacy code.
Java 8 example to convert LocalDateTime to ZonedDateTime. Also, learn to convert ZonedDateTime to LocalDateTime instance with example.
Java examples to convert a date from one timezone to another timezone. We will see the examples using ZonedDateTime, Date and Calendar classes.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.