It's odd enough, but I didn't find any result about converting Joda(Time) DateTime
to Unix DateTime (or timestamp, whichever is the correct name). How can I do this?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Any object that inherits from
BaseDateTime
(includingDateTime
) has the methodAccording to the API it:
So a working example to get the seconds would simply be:
For completeness, the definition of the Unix Timestamp according to Wikipedia:
Java 8 added a new API for working with dates and times. With Java 8 you can use