diff --git a/vlib/pg/orm.v b/vlib/pg/orm.v index ed0b1b4426..31f9617847 100644 --- a/vlib/pg/orm.v +++ b/vlib/pg/orm.v @@ -266,6 +266,11 @@ fn str_to_primitive(str string, typ int) ?orm.Primitive { return orm.Primitive(str) } orm.time { + if str.contains_any(' /:-') { + date_time_str := time.parse(str) ? + return orm.Primitive(date_time_str) + } + timestamp := str.int() return orm.Primitive(time.unix(timestamp)) }