当前位置:网站首页>thymeleaf中的日期格式转化
thymeleaf中的日期格式转化
2022-08-03 11:07:00 【qq_25073223】
Thymeleaf模板引擎
Thymeleaf作为众多模板引擎中的一种,我最初也是对它充满了陌生,在我学习SpringBoot并且试图通过学习来搭建属于自己的个人博客网站时,前端代码是少不了的,选择Thymeleaf来写模板自然不是因为我学的有多么好,而是因为我选择的教程是用的Thymeleaf,而我又不会其他的…
当然,学习Thymeleaf之前还是需要掌握一点web的知识的,我认为有着web基础多多少少能为我们的Thymeleaf之路提供了一点便利,减少一丢丢的痛苦。
Thymeleaf模板文件后缀名就是.html, 制作完成后,我们可以直接打开浏览效果
使用之前我们需要现在我们的SpringBoot项目中添加Thymeleaf的依赖,即在pom.xml文件中添加如下代码:
<!-- thymeleaf模板依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
我们的html文件也需要放置在template的文件夹下,这样我们就可以开始使用Thymeleaf模板引擎了
还有一个存放静态资源的文件夹static
在制作项目中
发现数据库中的datetime读取出来后
显示出的时间不利于查看
使用#dates.format来解决
<span th:text="${#dates.format(info.date, 'yyyy-MM-dd')}"></span>
或者是
<span th:text="${#dates.format(orderDetail.startTime,'yyyy-MM-dd HH:mm:ss')}"></span>
边栏推荐
- 用于发票处理的 DocuWare,摆脱纸张和数据输入的束缚,自动处理所有收到的发票
- ScrollView嵌套RecyclerView滚动冲突
- complete knapsack problem
- 请问应该用什么关键字将内容主题设置为 dark 呢
- 记住用户名案例(js)
- Skills required to be a good architect: How to draw a system architecture that everyone will love?What's the secret?Come and open this article to see it!...
- Who is more popular for hybrid products, depending on technology or market?
- MATLAB Programming and Applications 2.6 Strings
- 机器学习概述
- 「全球数字经济大会」登陆 N 世界,融云提供通信云服务支持
猜你喜欢

使用.NET简单实现一个Redis的高性能克隆版(一)

for in 和 for of的区别

XDR平台架构与关键技术解析
![[Detailed explanation of binary search plus recursive writing method] with all the code](/img/51/c4960575a59f8ca7f161b310e47b27.png)
[Detailed explanation of binary search plus recursive writing method] with all the code

ABAB-740新语法

干货!一种被称为Deformable Butterfly(DeBut)的高度结构化且稀疏的线性变换

What is the relationship between The Matrix and 6G?

本周四晚19:00知识赋能第4期直播丨OpenHarmony智能家居项目之设备控制实现

Skills required to be a good architect: How to draw a system architecture that everyone will love?What's the secret?Come and open this article to see it!...

Skills required to be a good architect: How to draw a system architecture that everyone will love?What's the secret?Come and open this article to see it!...
随机推荐
云原生 Dev0ps 实践
Realize 2d characters move left and right while jumping
Activiti产生的背景和作用
MySQL database combat (1)
用于发票处理的 DocuWare,摆脱纸张和数据输入的束缚,自动处理所有收到的发票
VRRP协议的作用及VRRP+OSPF配置方法
面试官:工作两年了,这么简单的算法题你都不会?
What is a smart contract?
This article takes you to understand the principle of CDN technology
SmobilerService 推送实现
SAP 电商云 Spartacus UI 的 External Routes 设计明细
完全背包问题
【多线程的相关内容】
Analysis of the idea of the complete knapsack problem
For invoice processing DocuWare, cast off the yoke of the paper and data input, automatic processing all the invoice received
Why is the new earth blurred, in-depth analysis of white balls, viewing pictures, and downloading problems
如何检索IDC研究报告?
[Detailed explanation of binary search plus recursive writing method] with all the code
LeetCode——622.设计循环队列
Machines need tokens more than people