Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当使用 DateFormatter.ISO_[*] 格式化程序格式化(分区/本地)日期时间时,我希望始终使用“小数秒”部分来格式化日期。
但是,我格式化的每个具有getNanos == 0格式化字符串的 DateTime 对象都是秒精度。
getNanos == 0
有没有办法强制格式化程序的这种行为?
(我想要这个是因为我希望日志易于解析,并且不幸的是 ISO_8601 期望这个)
** 旁注我使用的是 Threeten 库而不是 java8 本身(即将转换),但我不希望这在它们之间会有所不同