mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
pg: resolve PG string datetime values to V time.Time ones (#14336)
Co-authored-by: Merlin Diavova <md@merlindiaova.org>
This commit is contained in:
parent
650fb493bd
commit
106487d62f
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user