Java: Date Time

Prefer java.time package introduce in Java 8 Prefer java.time.format.DateTimeFormatter than java.text.SimpleDateFormatter Prefer java.time.Instant than java.sql.Timestamp The time since January 1st 1970 in milliseconds System.currentTimeMillis() new Date().getTime() new Timestamp(System.currentTimeMillis()).getTime() Measure Code Execution Duration java.util.TimeZone java.time.format.DateTimeFormatter java.time Package java.time – The main API for dates, times, instants, and durations Clock A clock providing access to the …

Java: Date Time Read More »

Install OpenJDK 11 on macOS

Install using HomeBrew Manual Install from AdoptOpenJDK See: Manual Install from Update download url based on the latest version available in this download page: Listing Installed JDK Version Switching JDK Version Get JAVA_HOME path and set it to environment variable. Add the following to ~/.bashrc , ~/.zshrc etc. JShell Also see: