convert a number string to a date



I a beginner in using BI Publisher, I have a number string in my XML which looks like 20161130 I need to create a date format 30/11/2016 from it, in the past I have received the XML in date format so was able to get my date using the template builder. The code I have in the field currently is
<?_025_Date_End_ID4?> what should the code look like? I'd appreciate a helping hand even if it just points me to the place I can find the correct code format
The same goes for a number string 1402 that needs to changed to 14:02

Thank you in advance



Reputable Poster
Try this :

On the word template using word plug in

1. Double click on the date field and it will take you to properties ; define it as a date field and choose the format
2. Double click on the time field and on the properties ; define it as time and choose the format.

This should work . Let me know if it did for you.


Thanks Sheba, your answer is correct and does work when the number string is set up a date in the XML, but I am getting a string of numerals and need convert them to the date format see the string below:

I have used the


Active Member

try to use concat and substring...<?xdofx:substr(026_Date_of_Creation_ID8,7,2)?>/<?xdofx:substr(026_Date_of_Creation_ID8,5,2)?>/<?xdofx:substr(026_Date_of_Creation_ID8,0,4)?>


Active Member
just corrected positions: <?xdofx:substr(026_Date_of_Creation_ID8,9,2)?>/<?xdofx:substr(026_Date_of_Creation_ID8,6,2)?>/<?xdofx:substr(026_Date_of_Creation_ID8,1,4)?>


Well Known Member
Maybe using this is clearer...


Rightmost 2 chars for the day-of-month; slash, then middle 2 digits starting from position 5 (the 1st 4 are the year) for the month; slash, then 1st 4 digits from the left for the year.