We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 769bb63 commit f213a7eCopy full SHA for f213a7e
date-time.java
@@ -0,0 +1,18 @@
1
+import java.text.*;
2
+import java.util.*;
3
+class datetime {
4
+ public static void main(String args[])
5
+ {
6
+ SimpleDateFormat formatDate = new SimpleDateFormat(
7
+ "dd/MM/yyyy HH:mm:ss z");
8
+
9
+ Date date = new Date();
10
+ // initialize "Date" class
11
12
+ formatDate.setTimeZone(TimeZone.getTimeZone("IST"));
13
+ // converting to IST or format the Date as IST
14
15
+ System.out.println(formatDate.format(date));
16
+ // print formatted date and time
17
+ }
18
+}
0 commit comments