I know there are a lot of date format topics, but I seem not to get this solved properly with the aid of the existing topics.
In a certain part of my workflow, I have a date stored as a variable var_deadlineconsultant1.
This date is 6/01/2019 (6th of January 2019 = so the format is dd/MM/yyyy).
When using the activity “write cell” to write it in a different excel sheet, the format changes to “1/06/2019” while it should be 06/01/2019 (6th of January 2019), and in my further calcualtions it keeps going with 01/06/2019 (first of june 2019)
How can I solve this?
ADDITION (= edit post):
I am using this function now: convert.ToDateTime(var_deadlineconsultant1).ToString(“dd/MM/yyyy”) and it works when the date is in the format d/MM/yyyy but not when it is already in dd/MM/yyyy. Can I solve this by adding an if function to check what the format of the initial value is? If different from dd/MM/yyyy then convert.ToDateTime(var_deadlineconsultant1).ToString(“dd/MM/yyyy”). But I am struggling how to put that in an if condition.
@ClaytonM, sorry for the tag, but you have been very useful to me in 2018, maybe you can easily help here as well :).
Many thanks in advance,