Splitting strings in JavaScript?

You can't split() a Date - you can split() a String, though.

You can't split() a Date - you can split() a String, though: var dat = "2009/12/12"; var r = dat. Split('/'); returns: "2009", "12", "12" To do the equivalent with a date, use something like this: var dat = new Date(); var r = dat.getFullYear(), dat.getMonth() + 1, dat.getDate(); returns: 2009, 4, 17.

In that case you'd be better off using a non-locale dependent solution and calling the following functions: dat.getDay(); dat.getMonth(); dat.getFullYear(); Sure they won't be zero padded, but that's easy enough to do.

Try dat.toString(). Split('/'); but this solution is locale dependent.

New Date("2009/12/12").toString(). Split('/'); // "Sat Dec 12 2009 00:00:00 GMT-0500 (Eastern Standard Time)" – Crescent Fresh Apr 17 '09 at 9:49 hey did I just found a bug in stackoverflow, I am pretty sure I deleted my answer because I found there's a problem as noted by the comment above. Plus, the author of the comment above is 'null'.

– kuosan Apr 17 '09 at 20:06.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions