0

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.

Andreas Fester
  • 36,091
  • 7
  • 95
  • 123
sai576
  • 111
  • 1
  • 8
  • 16

1 Answers1

1

“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");
Boris Treukhov
  • 17,493
  • 9
  • 70
  • 91