-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
hutool-core/src/test/java/cn/hutool/core/date/IssueI9C2D4Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cn.hutool.core.date; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class IssueI9C2D4Test { | ||
@Test | ||
public void parseHttpTest() { | ||
String dateStr = "Thu, 28 Mar 2024 14:33:49 GMT"; | ||
final DateTime parse = DateUtil.parse(dateStr); | ||
Assert.assertEquals("2024-03-28 14:33:49", parse.toString()); | ||
} | ||
|
||
@Test | ||
public void parseHttpTest2() { | ||
String dateStr = "星期四, 28 三月 2024 14:33:49 GMT"; | ||
final DateTime parse = DateUtil.parse(dateStr); | ||
Assert.assertEquals("2024-03-28 14:33:49", parse.toString()); | ||
} | ||
|
||
@Test | ||
public void parseTimeTest() { | ||
String dateStr = "15时45分59秒"; | ||
final DateTime parse = DateUtil.parse(dateStr); | ||
Assert.assertEquals("15:45:59", parse.toString().split(" ")[1]); | ||
} | ||
|
||
@Test | ||
public void parseTimeTest2() { | ||
String dateStr = "15:45:59"; | ||
final DateTime parse = DateUtil.parse(dateStr); | ||
Assert.assertEquals("15:45:59", parse.toString().split(" ")[1]); | ||
} | ||
} |