Hi
Are you trying to store data in a Date format excel column? If so, you need to convert it into an integer.
Let's assume you want to write in Excel a date that is stored in a variable called 'myNewDate' in the standard string format PA flow uses internally. So, I would try the following:
add(div(sub(ticks(variables('myNewDate'),ticks('1900-01-01')),864000000000),2)
The reason is, that according to this post, the date calendar in Excel is an integer representing the number of days since January 1st, 1900. Please also note, that, according to this web site:
Days Since 1900-01-01 (+2) is used in the Microsoft Excel date functions such as DAY(serial_number) and WEEKDAY().
Note, Excel's serial number is 2 higher than the number on this page.
- In Excel January 1 is serial number 1. In this converter midnight January 1, 1900 is 0, after 1 day it is midnight on January 2. To correct this you have to add/subtract 1.
- Excel incorrectly sees 1900 as a leap year (for compatibility with Lotus 1-2-3) so you have to add/subtract 1 to all days when using in Excel. Also see: Excel incorrectly assumes that the year 1900 is a leap year
Hope this helps