For example, a JSP page that reads a column in a date format in a database may appear as 1988-05-03 00:00:00 format, but we don't want the next 00:00:00 time, just want the previous month and year, then how to make the change?
Method One: We can use SimpleDateFormat to format the date after the action in the background and then display it on the JSP page. This method is the simplest of the most easy to think of, but this method is a little bit cumbersome (personally, including the background of transcoding operations), the following for everyone to talk about method Two, personally think is relatively simple point. Method Two: Directly in the JSP page modification, if we want to display the Birthday field, first in the corresponding JSP page to introduce the label <% @taglib uri= "http://java.sun.com/jsp/jstl/fmt" prefix= "FMT "%> then the column corresponding to the JSP page to be modified: <fmt:formatdate value=" ${birthday} "pattern=" Yyyy-mm-dd "/> This allows you to format the pattern according to the format you want.
About conversion of date data type formatting