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 @ChanManChan, there is currently no way to add a chrono::Duration/chrono::TimeDelta directly to a bson::DateTime. Your current approach looks reasonable. Enabling the chrono-0_4 feature flag if you have not done so already will also allow you to convert more easily between bson::DateTime and chrono::DateTime via the to_chrono and from_chrono methods.
Hi @ChanManChan, there is currently no way to add a chrono::Duration/chrono::TimeDelta directly to a bson::DateTime. Your current approach looks reasonable. Enabling the chrono-0_4 feature flag if you have not done so already will also allow you to convert more easily between bson::DateTime and chrono::DateTime via the to_chrono and from_chrono methods.
Thanks for the suggestions but I think I'm sticking with my solution if you find it reasonable.
Is there a better way to add chrono::Duration to bson::DateTime without converting to chrono::DateTime?
currently I'm doing this
expires_at: DateTime::from_millis(now.timestamp_millis() + duration.num_milliseconds()),
The text was updated successfully, but these errors were encountered: