html - JSP and JavaScript convert date -
i have problem while trying convert specific type of date.
my goal format: dd/mm/yyyy
the current date format: thu apr 04 00:00:00 eest 2013
when alerted using javascript, responds not date. used many solutions format on jsp:
<fmt:formatdate value="${thedate}" pattern="dd/mm/yyyy"/>
result error:
attempt convert string "thu apr 04 00:00:00 eest 2013" type "java.util.date", there no propertyeditor type.
and in javascript:
var datecreation = new date(thedate);
the problem in javascript says datecreation
not date. ideas?
problem date string "thu apr 04 00:00:00 eest 2013"
when tried date string got illegelargumentexception
change "thu apr 04 00:00:00 eest 2013"
"thu apr 04 00:00:00 est 2013"
working fine.
i'm unable guess why got eest
(one e extra).
public static void main(string[] args) { date date = new date("thu apr 04 00:00:00 est 2013"); system.out.println(date); }
you getting error in javascript because passing same string js guess.
Comments
Post a Comment