这可能吗?我找到了一些与 localDateTime 相互转换的解决方案,如图所示 here
但我找不到 Joda Instant 的解决方案...
最佳答案
您可以使用纪元毫秒来转换:
Timestamp ts = ....;
Instant i = new Instant(ts.getTime());
Timestamp ts2 = new Timestamp(i.getMillis());
关于java.sql.Timestamp 到 Joda Instant,反之亦然,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34911400/