[ This is a re-post from a post I made to an internal forum ; but I think it should help here also ]
The following Activity works - using Java Steps.
You might want to re-factor this into a Function (or two functions I guess) : or at least re-factor into a single Activity rather than the two I'm using here (one that using Params, the other using Pages - which calls the first one).
Additionally: I decided to split the Date and Time Components into a PRPC 'Date' Property and a PRPC 'TimeOfDay' Property - this is because these two types have simple well-defined internal-storage formats in the help:
Has a Table showing different 'casting' operations allowed in Pega7 : and for Text->Date, and Text->TimeOfDay; the casting operation is marked as 'C'.
Copies the value without examining whether it is valid.
So it's on us to make sure the Text Property being cast to Date/TimeOfDay is really what we need it to be.
I'm using the Joda Time Library : but this is already included in PRPC - so no need to import anything.
Joda Time has two simple types called 'LocalDate' and 'LocalTime' - which are conceptually the same as a PRPC 'Date' and a PRPC 'TimeOfDay' (They represent just a date and just a time only : no timezones to complicate things).
They also provide validation checks: including rejecting non-existant dates (2015-02-29 will fail [not a leap year], whereas 2016-02-29 is fine [is a leap year]) for instance).
Java Steps are shown below - First Date and then Time:
The Activity is essentially hardcoded to only accept dates exactly in one of them variations of the ISO-8601. formats. (Change the Property-Set containing the 'substring' to slice the date /time differently)
NOTE: I actually had overly formatted the timestring (although it still appeared to have worked...) in the second Java Step.
The 'internal represenation' for the 'TimeOfDay' type has no separators; so the step should be in fact this: