pg: resolve PG string datetime values to V time.Time ones (#14336)
Co-authored-by: Merlin Diavova <md@merlindiaova.org>master
parent
650fb493bd
commit
106487d62f
|
@ -266,6 +266,11 @@ fn str_to_primitive(str string, typ int) ?orm.Primitive {
|
||||||
return orm.Primitive(str)
|
return orm.Primitive(str)
|
||||||
}
|
}
|
||||||
orm.time {
|
orm.time {
|
||||||
|
if str.contains_any(' /:-') {
|
||||||
|
date_time_str := time.parse(str) ?
|
||||||
|
return orm.Primitive(date_time_str)
|
||||||
|
}
|
||||||
|
|
||||||
timestamp := str.int()
|
timestamp := str.int()
|
||||||
return orm.Primitive(time.unix(timestamp))
|
return orm.Primitive(time.unix(timestamp))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue