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.
如何在 Java 中将字符串数据类型作为 PT1M 转换为 ISO 8601 时间标准?
eg:String date=" PT1M ";转换成ISO 861时间标准。
String date=" PT1M ";
“PT1M”是一段时间(“一分钟”),而不是时间本身。它已经是ISO 8601格式。因此,我不确定您到底在问什么,但我认为您想要:
final Period period = new Period("PT1M");