1、jsp头部加:<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
2、例子:<td><fmt:formatDate value="${product.createDate }" pattern="yyyy-MM-dd"/></td>,product.createDate为时间戳格式。
3、js中转换:new Date(temp.createDate).toLocaleString().substring(0, 10).replace(/年|月|//g, "-"),emp.createDate为获取到后台传来的时间戳。