You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've browsed issues and the forum to try to find a way to obtain a DateTime (to get a proper server time timestamp instead of getting/displaying the UTC date/time on my resulting pages), but I have trouble finding a good way to implement this.
From a SQLite datetime entry stored as auto-generated (default current_timestamp), how should I best proceed to obtain a DateTime<FixedOffset>, or DateTime<local> (since the stored datetime has no time zone by default, it's assumed as UTC) ?
Thanks a lot for any answer !
Hi again! Still struggling with this issue, I read issue #598 on the topic, and I'd like to implement the conversion layer in a way that would let me specify DateTime<Local> on the structs used in sqlx::query_as! macros
without having to disable the type checking
without having to do an explicit conversion on every use of the typing (i.e. no internal struct used for querying then mapped to external struct)
Is there a trait that can be implemented to make the type conversion transparent to both the type checker and the developer ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! I've browsed issues and the forum to try to find a way to obtain a DateTime (to get a proper server time timestamp instead of getting/displaying the UTC date/time on my resulting pages), but I have trouble finding a good way to implement this.
From a SQLite
datetime
entry stored as auto-generated (default current_timestamp
), how should I best proceed to obtain aDateTime<FixedOffset>
, orDateTime<local>
(since the storeddatetime
has no time zone by default, it's assumed as UTC) ?Thanks a lot for any answer !
Hi again! Still struggling with this issue, I read issue #598 on the topic, and I'd like to implement the conversion layer in a way that would let me specify
DateTime<Local>
on the structs used insqlx::query_as!
macrosIs there a trait that can be implemented to make the type conversion transparent to both the type checker and the developer ?
Beta Was this translation helpful? Give feedback.
All reactions