Snippet 1
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
public class CurrentDateTimeExample1 {
public static void main(String[] args) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
System.out.println(dtf.format(now));
}
}
Similar Snippets
Creating Java Main Method Code Example – java
Find Duplicates In Arraylist Java Code Example – java
Java Creat A Folder Code Example – java
Copyright © Code Fetcher 2020