How to translate custom date in xml?

Post Reply
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

How to translate custom date in xml?

Post 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.
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

How to translate custom date in xml?

Post 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
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

How to translate custom date in xml?

Post by lovestjarna »

Fantastic... that solved it!

Thanks for the quick and exact help.
Post Reply