Last active
April 27, 2019 22:04
-
-
Save juanpabloprado/a7a13358dbefa3e195cfe94381767888 to your computer and use it in GitHub Desktop.
Specialized Formatters on the Java Shell tool
This file contains 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
jshell> LocalDateTime ldt = LocalDateTime.now(); | |
ldt ==> 2019-04-27T16:56:46.267683 | |
jshell> String dateTime = ldt.format(DateTimeFormatter.ofPattern("yyyyMMdd")); | |
dateTime ==> "20190427" | |
jshell> import java.nio.file.Path; | |
jshell> import java.nio.file.Paths; | |
jshell> Path target = Paths.get("app_props_" + dateTime + ".properties"); | |
target ==> app_props_20190427.properties | |
jshell> import java.nio.file.Files; | |
jshell> Files.createFile(target).getFileName(); | |
$95 ==> app_props_20190427.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment