Jump to content

Date conversion


jleich

Recommended Posts

binding some data to a componentart datagrid. the date comes in as yymmdd (120312) and for display I do a string format "MM/dd/yyyy". If a user has selected an item in the grid I use a javascript function to loop through the items and build an xml string to update some database records. When getting to the date column it shows Mon Mar 12 00:00:00 CST 2012. Want to reformat that to MM/dd/yyyy before sending off to database. Help??

Link to comment
Share on other sites

Thanks! I did end up with getting what I wanted with below...if (newAtt.name == "InvoiceDate") {var now = new Date(gridItem.get_cells().Value);var curr_date = now.getDate();var curr_month = now.getMonth();curr_month++;var curr_year = now.getFullYear();newAtt.nodeValue = curr_month + "/" + curr_date + "/" + curr_year;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...