Mysql acquires datetime-type data, followed by A. 0 implementation method, datetime.0
The data type of mysql is datetime, and the data stored in the database is 05:02:02. Uploaded to java becomes 05:02:02. 0, with an additional tail. 0,
You can use the following centralized method to display the format:
1. The regtime type can be used in this way only by date type. It is implemented through jstl.
<% @ Taglib uri = "http://java.sun.com/jsp/jstl/fmt" prefix = "fmt" %>
<Fmt: formatDate value = "$ {userDb. regtime}" pattern = "yyyy-MM-dd HH: mm: ss"/>
2. The regtime type is String, which is implemented through js.
<Div> <script> document. write ("$ {userDb. regtime}". substring (0, 19); </script> </div>
3. The regtime type is String, which is implemented through jstl.
<% @ Taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions" %>
<Div >$ {fn: substring (userDb. regtime, 0, 19)} </div>
Result: 05:02:02
The above mysql obtains datetime data, which will be followed by. the implementation method of 0 is to share all the content with you, hoping to give you a reference, and hope you can provide more support for helping customers.