以上都是获取当前时间的时间戳。而要想使用localdateTime获取当前时间,只需要LocalDateTime.now()即可。 结果如下: 原文链接: https://onlyou.blog.csdn.net//article/details/82424299