Hey all, I'm wanting to split() a date field into the 3 elements (dd, mm and yyyy) and put it into 3 seperate XML elements. this shouldn't be a problem, however, the textbox that it's entered into has a default value of dd/mm/yyyy to try and show the user that that's the format they should use. But, I know I can't fully trust people, and most likely some will put in dd-mm-yyyy or dd\mm\yyyy (people using US formatted dates, mm/dd/yyy, is another problem altogether).
So, I was wondering if there's any way you can sue the split value with multiple things that it will split at ?
I feel this would be easier than:
i don't know if this works yet even, I'm new to VBscript and just wrote this then.
Any help would be appreciated, thankyou.
Damon
So, I was wondering if there's any way you can sue the split value with multiple things that it will split at ?
I feel this would be easier than:
Code:
dateArray = split(dateString,"/")
If Ubound(dateArray) - LBound(dateArray) < 2 Then
dateArray = split(dateString,"-")
If Ubound(dateArray) - LBound(dateArray) < 2 Then
dateArray = split(dateString,"\")
End If
End If
i don't know if this works yet even, I'm new to VBscript and just wrote this then.
Any help would be appreciated, thankyou.
Damon