From 01dbb4461df962900e545777cf461fbf25c5b104 Mon Sep 17 00:00:00 2001 From: Hogen Date: Wed, 6 Mar 2024 18:33:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.API/COMCMS.API.csproj | 4 ++-- COMCMS.Common/COMCMS.Common.csproj | 6 +++--- COMCMS.Common/Utils.cs | 10 +++++++++- COMCMS.Core/COMCMS.Core.csproj | 2 +- COMCMS.Web/COMCMS.Web.csproj | 24 ++++++++++++------------ 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/COMCMS.API/COMCMS.API.csproj b/COMCMS.API/COMCMS.API.csproj index 21e1461..9d0ac76 100644 --- a/COMCMS.API/COMCMS.API.csproj +++ b/COMCMS.API/COMCMS.API.csproj @@ -5,9 +5,9 @@ - + - + diff --git a/COMCMS.Common/COMCMS.Common.csproj b/COMCMS.Common/COMCMS.Common.csproj index 8c76824..1cd9c50 100644 --- a/COMCMS.Common/COMCMS.Common.csproj +++ b/COMCMS.Common/COMCMS.Common.csproj @@ -6,11 +6,11 @@ - + - - + + diff --git a/COMCMS.Common/Utils.cs b/COMCMS.Common/Utils.cs index af95441..3c76c4e 100644 --- a/COMCMS.Common/Utils.cs +++ b/COMCMS.Common/Utils.cs @@ -383,7 +383,15 @@ namespace COMCMS.Common { return Regex.IsMatch(StrSource, @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$"); } - + /// + /// 是否为日期+时间型字符串 + /// + /// + /// + public static bool IsDateTime(string StrSource) + { + return Regex.IsMatch(StrSource, @"^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"); + } /// /// 正则手机型号 /// diff --git a/COMCMS.Core/COMCMS.Core.csproj b/COMCMS.Core/COMCMS.Core.csproj index 5a99716..9432439 100644 --- a/COMCMS.Core/COMCMS.Core.csproj +++ b/COMCMS.Core/COMCMS.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index 4c9a030..6dc1c05 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -6,23 +6,23 @@ - - - - - - - - - + + + + + + + + + - + - - + +