gpt4 book ai didi

java - 如何将 java.sql.timestamp 转换为 LocalDate (java8) java.time?

转载 作者:IT老高 更新时间:2023-10-28 11:21:40 25 4
gpt4 key购买 nike

在 Java 8 中,如何将 Timestamp(在 java.sql 中)转换为 LocalDate(在 java.时间)?

最佳答案

你可以这样做:

timeStamp.toLocalDateTime().toLocalDate();

Note that timestamp.toLocalDateTime() will use the Clock.systemDefaultZone() time zone to make the conversion. This may or may not be what you want.

关于java - 如何将 java.sql.timestamp 转换为 LocalDate (java8) java.time?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23263490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com