What is the proper way to use parseDateTime

0
Hi there, I have string fields which contain a date string that I want to convert to a dateTime instance. I tried parseDateTime('2005-11-04', 'yyyy-MM-dd', dateTime(1800)) to convert my date string to a dateTime instance, and if it fails (which should not be the case) it should return a dateTime instance set to the year 1800. For some reason, I get 5/3/2011 (todays date) when the parsed dateTime is shown on a form. Am I not using parseDateTime correctly ?
asked
1 answers
3

If your date string is in this format 2005-11-04 you need to use it like this: parseDateTime($yourattribute, 'yyyy-MM-dd')

The second argument of parseDateTime is in which format your date string is formatted.

answered