You are here: irt.org | FAQ | JavaScript | Date | Q605 [ previous next ]
Try:
<script language="JavaScript"><!-- var mmddyy = "12/31/99"; alert(mmddyy) var mm = mmddyy.substring(0,2); var dd = mmddyy.substring(3,5); var yy = mmddyy.substring(6,8); var ddmmyy = dd + '/' + mm + '/' + yy; alert(ddmmyy); // and back again... var dd = ddmmyy.substring(0,2); var mm = ddmmyy.substring(3,5); var yy = ddmmyy.substring(6,8); mmddyy = mm + '/' + dd + '/' + yy; alert(mmddyy); //--></script>