I need to convert a string variable in the ISO8601 format (e.g. 'P2D') into a variable of type Duration to use it in a task switch. The API method myText.toDuration() converts into the Date type not into Duration. How can I do that?

asked 17.03.2010 at 04:26

Matthias%20Lang's gravatar image

Matthias Lang
(suspended)
accept rate: 0%


You can use a literal for Duration objects:

Duration d = 'P2D';
link

answered 19.03.2010 at 09:47

Christian%20Strebel's gravatar image

Christian St... ♦
3.2k31338
accept rate: 88%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×37
×33

Asked: 17.03.2010 at 04:26

Seen: 2,213 times

Last updated: 17.03.2010 at 04:26