JSP and JavaScript convert date

jennymiller

New Member
I have a problem while trying to convert a specific type of date.My goal is to get it into this format: \[code\]dd/MM/yyyy\[/code\]The current date format: \[code\]Thu Apr 04 00:00:00 EEST 2013\[/code\]When I alerted using JavaScript, it responds that it is not a date. I used many solutions like to format it on JSP:\[code\]<fmt:formatDate value="http://stackoverflow.com/questions/15831561/${theDate}" pattern="dd/MM/yyyy"/> \[/code\]Result error: \[code\]Attempt to convert String "Thu Apr 04 00:00:00 EEST 2013" to type "java.util.Date", but there is no PropertyEditor for that type.\[/code\]And even in Javascript:\[code\]var dateCreation = new Date(theDate);\[/code\]The problem in JavaScript is that it says that \[code\]dateCreation\[/code\] is not a date. Any ideas?
 
Back
Top