var input = '02/04/2012'; var m = input.replace(/(\d+).(\d+)/,"$2/$1"); var date = new Date(m); alert(date);