File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
src/main/java/com/coderolls/java/date_and_time/datetimeformatter Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Link to the PlayList: https://www.youtube.com/watch?v=uhPLWdvrF9g&list=PLB1G
47
47
40 . [ Calculate Difference Between Two Dates Using Java 8 ChronoUnit] ( https://youtu.be/m8qP0ZyhMYo )
48
48
41 . [ Instant Class In Java 8 Date And Time API] ( https://youtu.be/7k-YYH4yUxQ )
49
49
42 . [ ZonedDateTime Class In Java 8 Date And Time API] ( https://youtu.be/OgZYxNiwm2Y )
50
-
50
+ 43 . [ How To Format LocalDateTime In Java 8? ] ( https://youtu.be/QMvKaHbvYwM )
51
51
52
52
## [ Chick here to Subscribe our YouTube Channel] ( https://www.youtube.com/channel/UCl31HHUdQbSHOQfc9L-wo3w?sub_confirmation=1 )
53
53
Original file line number Diff line number Diff line change
1
+ package com .coderolls .java .date_and_time .datetimeformatter ;
2
+
3
+ import java .time .LocalDateTime ;
4
+ import java .time .format .DateTimeFormatter ;
5
+
6
+ public class DateTimeFormatterExample {
7
+
8
+ public static void main (String [] args ) {
9
+
10
+ LocalDateTime dt = LocalDateTime .now ();
11
+ System .out .println (dt );
12
+ System .out .println ();
13
+ DateTimeFormatter formatter = DateTimeFormatter
14
+ .ofPattern ("dd/MM/yyyy HH:mm:ss" );
15
+
16
+ String dtFormatted = formatter .format (dt );
17
+ System .out .println (dtFormatted );
18
+
19
+
20
+ }
21
+
22
+ }
You can’t perform that action at this time.
0 commit comments