Forums Register Login

Displaying Timestamp object in a form

+Pie Number of slices to send: Send
Hello,
I'm trying to display a field ( type timestamp) in the form on the browser. This is wut i tried to do:

and then:
out.println("<TR><TD width=150 align = right >");
out.println(" initialized: ");
out.println("/TD");
out.println("<TD align = left >");
out.println("<INPUT type=text name=initialized value="(new SimpleDateFormat("EEE' 'YYYY/mm/dd' 'HH:mm:ss")).format((java.util.Date) +member.initialized + , new StringBuffer(),new FieldPosition(DateFormat.YEAR_FIELD)).toString();">");

Ofcourse, its not working..any suggestions or help would be greatly appreciated. thanks a lot
+Pie Number of slices to send: Send
I would experiment with SimpleDateFormat outside the servlet environment until I got the desired result. Incidently, a SimpleDateFormat object is fairly expensive to create but can be used repeatedly if you keep it as an instance variable in your servlet. Just synchronize on it to avoid having two requests try to use it at once.
Bill
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 821 times.
Similar Threads
How to retrive data two times from database in sinble jsp page.
Value in dropdown from servlet
how to pass multiple values through hyperlink to a jsp page ?
Connection Pooling
printout
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:08:37.