How to convert string into mendix date and time

0
Hi Experts, I want to convert string (801022) into mendix date and time (22/10/1980) .  Note : Here am getting string (801022) from JSON and am trying to parse with mendix date and time. Can you please tell me that how to achieve this. Thanks In Advance.
asked
1 answers
1

You can do that using date time functions in a microflow expression. Let say you have a string variable containing date string as '801022'. Now when creating the object of you entity where you have to set some DateTime attribute, use this expression to get the formatted date. 
 

parseDateTime($DateString, 'yyMMdd')

The ‘yyMMdd’ specifies the format in which date is represented in the string. As the string ‘801022’ represent year (yy) first, then month (MM) and then day (dd) so format string becomes yyMMdd

For time zone adjustment you can use any of these functions: parseDateTime OR parseDateTimeUTC
Please refer to documentation for details: https://docs.mendix.com/refguide/parse-and-format-date-function-calls

After the above logic, the date will be stored in Mendix object correctly. Now when you display that date on a page in your application, you can choose how it will be displayed (date format)

 

answered