Convert String Ptim into Iso 8601 Pt1M in Java [Duplicate]

Convert String Ptim into Iso 8601 Pt1M in Java [Duplicate]

How to convert the String data type as PT1M to ISO 8601 Time Standard in Java?

eg: String date=" PT1M "; convert into ISO 861 time standard.

0

1 Answer

“PT1M” is a period of time (“one minute”), not a time in itself. It is already in ISO 8601 format. As such I'm not sure exactly what you are asking, but I think that you want:

final Period period = new Period("PT1M");
1
Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.