PrimitiveDateTime
to Unix Timestamp
#627
Replies: 1 comment
-
Previously: #369, #390, #395, #454, #458, #553 The documentation for 0.2 is not relevant, as the current series is 0.3. However, the deprecation message on your link clearly states why it doesn't exist any more. As |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, firstly, thank you for making an awesome crate. This has been extremely helpful in combination with sqlx for what I'm working on, though I do currently find myself at a roadblock.
I am trying to use Discord timestamps which require a Unix timestamp to correctly create. While performing an operation to go from OffsetDateTime to PrimitiveDateTime (which allows a call to
to_unix_timestamp()
) is relatively simple, I have not found a good way so far to go from OffsetDateTime back to PrimitiveDateTime.I am aware that PrimitiveDateTime does not provide a timezone, which OffsetDateTime assumes. I saw that this was a feature since at least 0.2.6, but I cannot find a way to do this now, and was hoping the best person to ask was the developer of the crate themselves.
I apologise if this seems dumb, I've been trying my best to come up with a solution by myself for the last couple of weeks and I'm coming short on answers! If you need any information from me, please let me know and I'll do my best to provide whatever you require as soon as I can!
Beta Was this translation helpful? Give feedback.
All reactions