Add "yyyy-MM-dd HH:mm:ss" string format
diff --git a/cast_test.go b/cast_test.go
index 6b73ff8..2e418ec 100644
--- a/cast_test.go
+++ b/cast_test.go
@@ -212,3 +212,10 @@
assert.Equal(t, v.expected, ToDuration(v.input))
}
}
+
+func TestStringToDate(t *testing.T) {
+ d := "2016-03-06 15:28:01"
+ format := "2006-01-02 15:04:05"
+ v, _ := time.Parse(format, d)
+ assert.Equal(t, ToTime(d), v)
+}
diff --git a/caste.go b/caste.go
index 23f59a1..23f0fe8 100644
--- a/caste.go
+++ b/caste.go
@@ -513,6 +513,7 @@
"02 Jan 2006",
"2006-01-02 15:04:05 -07:00",
"2006-01-02 15:04:05 -0700",
+ "2006-01-02 15:04:05",
})
}