Hello friends,
I want to display the date retrieved from database on my JSP in dd/mm/yyyy format.
However, if i directly use - result.getString(col_num)
it gives me - yyy/mm/dd hh:mim:sec:millisecs

Can you please tell me, how to convert retrieved date.
It won't be possible for me to use - select convert() query
So, please tell me how to convert once i've retrieved the date in a variable.

Thank you.

use below scriptlet tag:::

java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat();
sdf.applyPattern("dd-MM-yyyy");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.