SyntaxFix
Write A Post
Hire A Developer
Questions
You don't need any date-specific functions for this, it's just string manipulation:
var parts = fecha2.value.split('-'); var newdate = parts[1]+'-'+parts[2]+'-'+(parseInt(parts[0], 10)%100);