Friday, July 11, 2014

How to convert date format dd-mmm-yy to yyyy-mm-dd in javascript

function changeDateFormat(dateToBeFormated){
var months = {'jan': '01', 'feb': '02', 'mar': '03', 'apr': '04', 'may': '05', 'jun': '06', 'jul': '07', 'aug': '08', 'sep': '09', 'oct': '10', 'nov': '11', 'dec': '12'};
var arr = dateToBeFormated.split('-'); // split based on '-'
var year = '20'+ arr[2] ; // add '20' before year
var month = months[arr[1].toLowerCase()] ; // convert month into lower
var day = arr[0] ;
if (day < 10) day = "0" + day; // add '0' if date is less then 10.
return [year,month,day].join('-'); // join value according to format.
}

Monday, July 7, 2014

How to get the lost java file data back in eclipse which is lost by sudden power off?

sometimes when we work on eclipse and suddenly power get off and we lost the whole page data.our page get blank.
Dont get disappoint .The solution of this problem is :

right click on the blank page go to the "replace with" option then click on previous from local history and you
will get back your lost page.