I’ve been trying to figure this out myself, but after a lot of searching, reading and testing, I am realising that this might be above my current abilities.
What I am trying to achieve is pretty straight forward on paper.
I have two dates variables:
„From“
„To“
This is the date format they output:
21.06.2020
27.06.2020
My Goal:
I need to covert that %Variable%From% and %Variable%To% into an American date format and I need that info to be outputted into two new variables such as %Variable%FromUS% and of course %Variable%ToUS%
This would be the text outcome of those new variables:
2020-06-21
2020-06-27
Careful about the assumption this is the American date format. Often I see things like 05/04/2020 - today's date (where the month comes before the day and then finally the year).
But the method of decomposing the German date format and composing a USAn one from it still holds.
thanks a lot for the quick and precise answer. This works as expected and I guess I have to add to my list of things to learn "regex"
@MartinPacker thanks for specifying, in my case the output format will always be same. So this definitely does the work.
In 20 years of informatics, I can honestly say this is the best forum I have ever had the pleasure to be part of. Love this place, learning so much from you guys.
@gglick has provided you with the solution, but FYI the "US" format that you asked for is generally known as the "ISO" or "International" format: "YYYY-MM-DD"
The typical U.S. (American) format is that given by "MM/DD/YYYY":