mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复DateUtil.parse 给定一个时间解析错误问题
This commit is contained in:
parent
a42c8dbd99
commit
be3312d2e0
@ -2,7 +2,7 @@
|
|||||||
# 🚀Changelog
|
# 🚀Changelog
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.8.22(2023-08-04)
|
# 5.8.22(2023-08-07)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【core 】 NumberUtil.nullToZero增加重载(issue#I7PPD2@Gitee)
|
* 【core 】 NumberUtil.nullToZero增加重载(issue#I7PPD2@Gitee)
|
||||||
@ -12,6 +12,7 @@
|
|||||||
* 【core 】 修复NumberUtil.toBigDecimal转换科学计数法问题(issue#3241@Github)
|
* 【core 】 修复NumberUtil.toBigDecimal转换科学计数法问题(issue#3241@Github)
|
||||||
* 【core 】 修复PathUtil.moveContent当target不存在时会报错问题(issue#3238@Github)
|
* 【core 】 修复PathUtil.moveContent当target不存在时会报错问题(issue#3238@Github)
|
||||||
* 【db 】 修复SqlUtil.formatSql 格式化的sql换行异常(pr#3247@Github)
|
* 【db 】 修复SqlUtil.formatSql 格式化的sql换行异常(pr#3247@Github)
|
||||||
|
* 【core 】 修复DateUtil.parse 给定一个时间解析错误问题(issue#I7QI6R@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.8.21(2023-07-29)
|
# 5.8.21(2023-07-29)
|
||||||
|
@ -27,7 +27,7 @@ public class DatePattern {
|
|||||||
*
|
*
|
||||||
* @since 5.3.6
|
* @since 5.3.6
|
||||||
*/
|
*/
|
||||||
public static final Pattern REGEX_NORM = Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}(\\s\\d{1,2}:\\d{1,2}(:\\d{1,2})?)?(.\\d{1,6})?");
|
public static final Pattern REGEX_NORM = Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}(\\s\\d{1,2}:\\d{1,2}(:\\d{1,2})?(.\\d{1,6})?)?");
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------- Normal
|
//-------------------------------------------------------------------------------------------------------------------------------- Normal
|
||||||
/**
|
/**
|
||||||
|
27
hutool-core/src/test/java/cn/hutool/core/date/IssueI7QI6RTest.java
Executable file
27
hutool-core/src/test/java/cn/hutool/core/date/IssueI7QI6RTest.java
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||||
|
* Hutool is licensed under Mulan PSL v2.
|
||||||
|
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||||
|
* You may obtain a copy of Mulan PSL v2 at:
|
||||||
|
* http://license.coscl.org.cn/MulanPSL2
|
||||||
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||||
|
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||||
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the Mulan PSL v2 for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package cn.hutool.core.date;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class IssueI7QI6RTest {
|
||||||
|
@Test(expected = DateException.class)
|
||||||
|
public void parseTest() {
|
||||||
|
DateUtil.parse("2023-08-04 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = DateException.class)
|
||||||
|
public void parseTest2() {
|
||||||
|
DateUtil.parse("2023-08-04-1");
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user