feat: time util

This commit is contained in:
Bobo
2025-05-28 23:55:43 +08:00
parent 89a69a9d4d
commit faa5817857
4 changed files with 19 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ func timeMarshalJSON(t time.Time, layout string) ([]byte, error) {
}
func ParseSlice(layout string, strings []string) ([]time.Time, error) {
times := []time.Time{}
var times []time.Time
for _, raw := range strings {
t, err := time.Parse(layout, raw)
if err != nil {