Java code vars & quot; 2005-12-1509: 41: 30 & quot; vardnewDate (Date. parse (s. replace (/-/g, & quot;/& quot;); http://docs.jquery.com/ui/datepicker/$.datepicker.formatdate
Java code
Var s = "09:41:30 ";
Var d = new Date (Date. parse (s. replace (/-/g ,"/")));
Http://docs.jquery.com/ui/datepicker/developer.datepicker.formatdate
Can also be implemented
Java code
// A piece of code found on stackoverflow, date in js
Function printDate (){
Var temp = new Date ();
Var dateStr = padStr (temp. getFullYear () +
PadStr (1 + temp. getMonth () +
PadStr (temp. getDate () +
PadStr (temp. getHours () +
PadStr (temp. getMinutes () +
PadStr (temp. getSeconds ());
Debug (dateStr );
}
Function padStr (I ){
Return (I <10 )? "0" + I: "" + I;
}
Java code
// Data type conversion in json format
Var cloudNormFileDateFormat2 = {
FormatDate: function (date ){
Return dateStr = this. padStr (1900 + date. year) + "-" +
This. padStr (1 + date. month) + "-" +
This. padStr (date. date) + "" +
This. padStr (date. hours) + ":" +
This. padStr (date. minutes) + ":" +
This. padStr (date. seconds );
},
PadStr: function (I ){
Return (I <10 )? "0" + I: "" + I;
}
};
Author "caniggia1986"