I would like to convert instances of the java.time.Instant class to and from strings.
java.time.Instant
I would like to use the format exactly like java.time.format.DateTimeFormatter.ISO_INSTANT with the only difference that the colons in the format are omitted or replaced by dots so that they can be used without escaping in file names and URLs.
java.time.format.DateTimeFormatter.ISO_INSTANT
Example: 2011-12-03T10.15.30.001Z instead of 2011-12-03T10: 15: 30.001Z
See Javadoc for ISO_INSTANT: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT
You can create your own formatter as follows:
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH.mm.ss.SSSVV")
DateTimeFormatter Javadoc lists all possible markers with their value.
DateTimeFormatter
Source: https://habr.com/ru/post/1231949/More articles:Change the color of a specific letter in the console - matlabPHPMailer - OpenSSL error - phpEclipse code formatter multi-line closing bracket closing function - code-formattingUniversal Xcode iOS App Image Sizes - iosHow to perform operations with 'Γ¦', 'ΓΈ' and 'Γ₯' in C - cOrientDB parallel chart operations in Java - javaHow to combine a user registered on facebook with a user registered with the same email address - iosTypescript TSX and general parameters - genericsParsing a string in C # after reading the first and last alphabet - stringProlog Design Pattern for extending module predicates - objectAll Articles