Return to Snippet

Revision: 26585
at May 3, 2010 06:03 by yisreldov


Updated Code
// javascript:document.body.innerHTML%20=%20document.body.innerHTML.replace(/(\d{4})-(\d{2})-(\d{2})/ig,function(match,year,month,day){return%20(new%20Date(year,month,day).toLocaleString())%20});
document.body.innerHTML = document.body.innerHTML.replace(/(\d{4})-(\d{2})-(\d{2})/ig,function(match,year,month,day){return (new Date(year,month,day).toLocaleString()) });

Revision: 26584
at May 3, 2010 06:01 by yisreldov


Initial Code
// javascript:document.body.innerHTML%20=%20document.body.innerHTML.replace(/(\d{4})-(\d{2})-(\d{2})/ig,function(match,year,month,day){return%20(new%20Date(year,month,day).toLocaleString())%20});
document.body.innerHTML = document.body.innerHTML.replace(/(\d{4})-(\d{2})-(\d{2})/ig,function(match,year,month,day){return (new Date(year,month,day).toLocaleString()) });

Initial URL
javascript:document.body.innerHTML%20=%20document.body.innerHTML.replace(/(\d{4})-(\d{2})-(\d{2})/ig,function(match,year,month,day){return%20(new%20Date(year,month,day).toLocaleString())%20});

Initial Description
Will convert all of the mysql dates on the page to be localized.

Initial Title
Convert MySql Dates to localized dates

Initial Tags
javascript, date, textmate, convert

Initial Language
JavaScript