Probably a simple one, but I am scared of Java. I have a date in DDMMYYYY format. I want to change it to MMDDYYYY and insert '/' in the proper places. What is the function to use?
Printable View
Probably a simple one, but I am scared of Java. I have a date in DDMMYYYY format. I want to change it to MMDDYYYY and insert '/' in the proper places. What is the function to use?
Code:Javascript:
var str = new String("ddmmyyyy");
str = str.substr(0,2) + "/" + str.substr(2,3) + "/" + str.substr(5,4);
//substr(beging,length)
Java kinda the same except
String str new String("ddmmmyyyy");
//substring(int beginIndex, int endIndex)