mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add months between and hostname util
This commit is contained in:
@@ -819,4 +819,12 @@ public class DateUtilTest {
|
||||
final DateTime parse = DateUtil.parse(dt);
|
||||
Assert.assertEquals("2020-06-03 12:32:12", parse.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getBetweenMonthsTest() {
|
||||
List<String> months1 = DateUtil.getBetweenMonths(new Date(), new Date());
|
||||
Assert.assertEquals(1, months1.size());
|
||||
List<String> months = DateUtil.getBetweenMonths(DateUtil.parse("2020-05-08 3:12:3"), new Date());
|
||||
Assert.assertEquals(5, months.size());
|
||||
}
|
||||
}
|
||||
|
@@ -74,4 +74,9 @@ public class NetUtilTest {
|
||||
Assert.assertEquals("/", httpCookie.getPath());
|
||||
Assert.assertEquals("cookiedomain.com", httpCookie.getDomain());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLocalHostNameTest() {
|
||||
System.out.println(NetUtil.getLocalHostName());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user