View Single Post
Old 01-26-2013, 12:18 AM   PM User | #6
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,468
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by xelawho View Post
a fabulously unreliable approach... this:
Code:
var d=new Date("2013-01-25 22:31:55.809231")
  alert(d.getDate())
gives NaN in FF and IE and 25 in Chrome... regExing it, as per Ali's suggestion would appear much more sensible
Code:
new Date( "2013-01-25 22:31:55.809231".replace(" ","T")  ).toLocaleString()
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote