From 371ab48d7a82647e93ea3153e426cd1d85d42a0b Mon Sep 17 00:00:00 2001 From: john Date: Wed, 31 Oct 2018 16:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bgtime.StrToTime=E5=AF=B9?= =?UTF-8?q?=E5=B8=B8=E7=94=A8=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/os/gtime/gtime.go | 3 ++- geg/os/gtime/gtime_regex.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/g/os/gtime/gtime.go b/g/os/gtime/gtime.go index 0b8647f8e..cc1f6d619 100644 --- a/g/os/gtime/gtime.go +++ b/g/os/gtime/gtime.go @@ -25,9 +25,10 @@ const ( // "2018-02-09 20:46:17.897", // "2018-02-09T20:46:17Z", // "2018-02-09 20:46:17", + // "2018/10/31 - 16:38:46" // "2018-02-09", // 日期连接符号支持'-'或者'/' - TIME_REAGEX_PATTERN = `(\d{2,4}[-/]\d{2}[-/]\d{2})[\sT]{0,1}(\d{0,2}:{0,1}\d{0,2}:{0,1}\d{0,2}){0,1}\.{0,1}(\d{0,9})([\sZ]{0,1})([\+-]{0,1})([:\d]*)` + TIME_REAGEX_PATTERN = `(\d{2,4}[-/]\d{2}[-/]\d{2})[\sT-]*(\d{0,2}:{0,1}\d{0,2}:{0,1}\d{0,2}){0,1}\.{0,1}(\d{0,9})([\sZ]{0,1})([\+-]{0,1})([:\d]*)` ) var ( diff --git a/geg/os/gtime/gtime_regex.go b/geg/os/gtime/gtime_regex.go index 4f4463a28..03f0d51fa 100644 --- a/geg/os/gtime/gtime_regex.go +++ b/geg/os/gtime/gtime_regex.go @@ -19,6 +19,7 @@ func main() { "2018-02-09 20:46:17.897", "2018-02-09T20:46:17Z", "2018-02-09 20:46:17", + "2018/10/31 - 16:38:46", "2018-02-09", "2017/12/14 04:51:34 +0805 LMT", "2018/02/09 12:00:15",