From 645e224a8f4ac7aba3666c23cfa8346f93b4f3bc Mon Sep 17 00:00:00 2001 From: QNLanYang <117292352+QNLanYang@users.noreply.github.com> Date: Wed, 19 Aug 2026 11:02:01 +0800 Subject: [PATCH] fix(189pc): support localized time format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加了兼容电信天翼云盘返回时间戳的新格式,并标准化了其中的`U+202F` 窄空格,避免产生报错 The 189pc API may return localized timestamps such as "Aug 17, 2026, 8:33:35 PM" with a narrow no-break space before the AM/PM marker. Normalize U+202F spaces and support the comma-separated localized timestamp format. --- drivers/189pc/help.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/189pc/help.go b/drivers/189pc/help.go index bac8880a897..41a726a4e84 100644 --- a/drivers/189pc/help.go +++ b/drivers/189pc/help.go @@ -102,9 +102,10 @@ func (t *Time) UnmarshalXML(e *xml.Decoder, ee xml.StartElement) error { } func (t *Time) Unmarshal(b []byte) error { bs := strings.Trim(string(b), "\"") + bs = strings.ReplaceAll(bs, "\u202f", " ") var v time.Time var err error - for _, f := range []string{"2006-01-02 15:04:05 -07", "Jan 2, 2006 15:04:05 PM -07"} { + for _, f := range []string{"2006-01-02 15:04:05 -07", "Jan 2, 2006 15:04:05 PM -07", "Jan 2, 2006, 15:04:05 PM -07"} { v, err = time.ParseInLocation(f, bs+" +08", time.Local) if err == nil { break