mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
DateUtil.parse支持毫秒时间戳
This commit is contained in:
@@ -30,7 +30,7 @@ public class TestIssueI8CLBJ {
|
||||
Thread thread = new Thread(() -> {
|
||||
try {
|
||||
String valueFieldName = annotation.valueFieldName();
|
||||
System.out.println("valueFieldName:" + valueFieldName);
|
||||
//Console.log("valueFieldName:" + valueFieldName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@@ -1126,8 +1126,8 @@ public class DateUtilTest {
|
||||
|
||||
@Test
|
||||
public void isLastDayTest() {
|
||||
DateTime dateTime = DateUtil.parse("2022-09-30");
|
||||
int dayOfMonth = DateUtil.getLastDayOfMonth(dateTime);
|
||||
final DateTime dateTime = DateUtil.parse("2022-09-30");
|
||||
final int dayOfMonth = DateUtil.getLastDayOfMonth(dateTime);
|
||||
Assert.assertEquals(dayOfMonth, dateTime.dayOfMonth());
|
||||
Assert.assertTrue("not is last day of this month !!", DateUtil.isLastDayOfMonth(dateTime));
|
||||
}
|
||||
@@ -1167,4 +1167,11 @@ public class DateUtilTest {
|
||||
Assert.assertNotNull(parse);
|
||||
Assert.assertEquals("2019-10-22 09:56:03", parse.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issueI8NMP7Test() {
|
||||
final String str = "1702262524444";
|
||||
final DateTime parse = DateUtil.parse(str);
|
||||
Assert.assertEquals("2023-12-11 10:42:04", Objects.requireNonNull(parse).toString());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user