Hi,
The main question is:
How can I create a date object from a given date?
Context:
I am trying to do some calculations with a date given in the following format: DD/MM/YYYY .
What I am trying to do is to convert the given date to a date object so I could use the existing date methods (addMonths(X) / addDays(Y) ), however I could not find a method to create a date object providing the date.
The closest method I could find was Date.UTC() , which gives me the epoch representation of the given date, but I don’t know how to create a date object from it.
Current proposed step-by-step:
- get date in epoch format: [[ Date.UTC(LVAR1.substr(6,4), LVAR1.substr(3,2)-1,LVAR1.substr(0,2))
- convert epoch to date: ???
- do necessary calculations: addMonths(-2)
- convert to locale: toLocaleDateString(“pt-BR”) ]]
- profit!
P.S.:
I am sorry if this information is available somewhere else, I didn’t find it in https://docs.axure.com/axure-rp/reference/math-functions-expressions/#date-and-time neither in any other topic of this forum.
Thanks.
Regards,
Luiz Taboada