Wednesday, 15 August 2012

javascript - extract month day and year after parsed date d3.js -



javascript - extract month day and year after parsed date d3.js -

i parsed date json file function in d3.js:

var parsedate = d3.time.format("%m-%y").parse;

and date as:

var date = "tue jan 01 2013 00:00:00 gmt+0530 (india standard time)"

now want take out month, day, , year variable date , print it. how do that?

or can need print month, day, , year, not stuff tue (india standard time) etc.

edit: assuming mean javascript date object:

var date = new date("tue jan 01 2013 00:00:00 gmt+0530 (india standard time)"); var day = date.getday(); //returns 0 - 6 var month = date.getmonth(); //returns 0 - 11 var year = date.getfullyear(); //returns 4 digit year ex: 2000

javascript d3.js

No comments:

Post a Comment