Skip to content

Commit dcccfc1

Browse files
Its about Time and date
1 parent 8f8d525 commit dcccfc1

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

DateAndTime/bin/date/DateNtime.class

989 Bytes
Binary file not shown.

DateAndTime/bin/module-info.class

150 Bytes
Binary file not shown.

DateAndTime/src/date/DateNtime.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package date;
2+
3+
import java.text.SimpleDateFormat;
4+
import java.util.Date;
5+
6+
public class DateNtime {
7+
8+
public static void main(String[] args) {
9+
// TODO Auto-generated method stub
10+
Date date = new Date();
11+
System.out.println(date.toString());
12+
System.out.println(date.getTime());
13+
System.out.println(date.getMonth()+1);
14+
System.out.println(date.getYear()+1);
15+
16+
SimpleDateFormat sdf = new SimpleDateFormat("E yyyy/mm/dd");
17+
System.out.println(sdf.format(date));
18+
19+
}
20+
21+
}

DateAndTime/src/module-info.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
*
3+
*/
4+
/**
5+
*
6+
*/
7+
module DateAndTime {
8+
}

0 commit comments

Comments
 (0)