The data type of MySQL is datetime. The data stored in the database is 2015-01-19 05:02:02. When it is transferred to Java, it becomes 2015-01-19 05:02:02.0, with an extra .0 at the end. The display format can be formatted by the following centralized method: 1. The type of regtime must be date type to be used in this way, which can be achieved through jstl <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 2. The type of regtime is String, which is implemented by js <div><script>document.write("${userDb.regtime}".substring(0, 19));</script></div> 3. The type of regtime is String, which is implemented by jstl <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> Display results: 2015-01-19 05:02:02 The above article about how to obtain datetime type data in MySQL, followed by a .0 implementation method, is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JS implements Baidu search box
>>: How to change the CentOS server time to Beijing time
1. After entering the container cat /etc/hosts It...
Implementing process analysis (1) How to call rep...
As shown below: Yesterday: UNIX_TIMESTAMP(CAST(SY...
Today I want to summarize several very useful HTML...
HTML 4 HTML (not XHTML), MIME type is text/html, ...
Table of contents 1. Global Guard 1.1 Global fron...
Responsive design is to perform corresponding ope...
Application scenario: It is necessary to count th...
In combination with the scenario in this article,...
1. Create a new virtual machine from VMware 15.5 ...
Table of contents mvc mvp mvvm The source of Vue ...
Using the official MySQL image requires some modi...
need Recently, we need to migrate Node online ser...
A few days ago, I watched a video of a foreign gu...
The inline-block property value becomes very usef...