javascript - Removing last 9 characters from a string and then reformatting the remaining date characters -
my question has 2 parts. first remove last 9 characters generated string using jquery eg
2011-04-04t15:05:54
which leave date remaining. know use .substring function. after time removed need reformat date format
08.04.11 (for eg)
i learning how write jquery , appreciate code.
this pure javascript, jquery not needed.
var d1=new date(); d1.tostring('yyyy-mm-dd'); //returns "2009-06-29" d1.tostring('dddd, mmmm ,yyyy') //returns "monday, june 29,2009" another example fit case:
var d1=new date(); d1.tostring('dd.mm.yy'); //returns "08.04.11" more:
where can find documentation on formatting date in javascript?
Comments
Post a Comment