Skip to content

Commit 154306d

Browse files
committed
add loacltime
1 parent 7a08864 commit 154306d

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ java_se/~/
2727
/java_ee/.attach*
2828
/concurrent/.attach*
2929
/out/
30+
/java_test/.attach_pid*

.idea/compiler.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java_test/src/main/java/com/yiyun/inandout/Main.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
package com.yiyun.inandout;
22

3+
import org.junit.Test;
4+
35
import java.io.BufferedInputStream;
6+
import java.text.ParseException;
7+
import java.text.SimpleDateFormat;
8+
import java.time.LocalDateTime;
9+
import java.time.format.DateTimeFormatter;
10+
import java.util.Calendar;
11+
import java.util.Date;
412
import java.util.Scanner;
13+
import java.util.logging.SimpleFormatter;
514

615
public class Main {
716
public static void main(String[] args) {
@@ -11,4 +20,14 @@ public static void main(String[] args) {
1120
System.out.println(nextInt1);
1221
System.out.println(nextInt2);
1322
}
23+
@Test
24+
public void fun() throws ParseException {
25+
SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
26+
27+
Date parse = simp.parse("2014-08-11 21:00:00.000");
28+
System.out.println("parse = "+parse);
29+
LocalDateTime now = LocalDateTime.now();
30+
31+
System.out.println("now = " + now);
32+
}
1433
}

0 commit comments

Comments
 (0)