Page 1 of 1

How to translate custom date in xml?

Posted: Mon Aug 04, 2014 4:51 pm
by lovestjarna
I have xml-files where all the dates are created like this:

201407211600

its yyyyMMddHHmm. So its no standard and the switch doesn't recognize it as a standard when using variables. Is it any way to make these dates Switch-friendly?

Its a lot of work asking to get them correctly... 4 different companies included...



Should I open the xml as a first step? Script making it Switch-friendly? Or anything else?



For instance Im putting all files in different folders with deadline dates... but it looks really bad when having "1600" in the end of the name. And I can't find anyway to exclude the last 4 digits from the node.

How to translate custom date in xml?

Posted: Mon Aug 04, 2014 5:50 pm
by freddyp
As the number of characters is always the same you can easily use the "Segment" function on the right in the variables pane. You specify the 1-based index of the first character and the index of the last character separated by a comma. In your case that would be 1,8. So instead of removing the last 4 characters you keep the first 8.



Freddy

How to translate custom date in xml?

Posted: Tue Aug 05, 2014 12:30 am
by lovestjarna
Fantastic... that solved it!

Thanks for the quick and exact help.