Created
February 10, 2020 19:29
-
-
Save infinitecontext/4aa0ea0084f83ca3cbf2da134dee05d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| class App { | |
| public static void main(String[] args) { | |
| DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-mm-dd"); | |
| LocalDateTime now = LocalDateTime.now(); | |
| System.out.println("current date: " + formatter.format(now)); | |
| formatter = DateTimeFormatter.ofPattern("hh:mm:ss.msmsms"); | |
| System.out.println("current date: " + formatter.format(now)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment