mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
fix code
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
package cn.hutool.core.date;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
|
||||
public class LocalDateTimeUtilTest {
|
||||
|
||||
@@ -217,4 +220,11 @@ public class LocalDateTimeUtilTest {
|
||||
final int weekOfYear2 = LocalDateTimeUtil.weekOfYear(date1.atStartOfDay());
|
||||
Assert.assertEquals(5, weekOfYear2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ofTest2(){
|
||||
final Instant instant = DateUtil.parse("2022-02-22").toInstant();
|
||||
final LocalDateTime of = LocalDateTimeUtil.of((TemporalAccessor) instant);
|
||||
Console.log(of);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user