当前位置:网站首页>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>
边栏推荐
- 微信多开批处理(自动获取安装路径)
- Cross-chain bridge protocol Nomad suffers hacker attack, losing more than $150 million
- [Star Project] Little Hat Plane Battle (9)
- Programmers architecture practice way: software architecture basic concepts and thinking
- XDR平台架构与关键技术解析
- 嵌入式软件组件经典架构与存储器分类
- numpy
- Why is the new earth blurred, in-depth analysis of white balls, viewing pictures, and downloading problems
- 完全背包问题
- 【网络原理的概念】
猜你喜欢

shell编程-测试

赛灵思MPSOC裸机下的 USB调试实验

【LeetCode—第2题 两数之和 代码详解 】附有源码,可直接复制

Babbitt | Metaverse daily must-read: Players leave, platforms are shut down, and the digital collection market is gradually cooling down. Where is the future of the industry?...

Android 技术面试准备(含面试题及答案)

MySQL之json数据操作

Matplotlib

云原生 Dev0ps 实践

MySQL数据库实战(1)

Spinner文字显示不全解决办法
随机推荐
JS快速高效开发技巧指南(持续更新)
基于PHP7.2+MySQL5.7的回收租凭系统
MATLAB程序设计与应用 2.6 字符串
【AppCube】数字孪生万物可视 | 联接现实世界与数字空间
实现2d人物在跳跃的同时左右移动
优维低代码:Provider 构件
MySQL之json数据操作
【LeetCode—第2题 两数之和 代码详解 】附有源码,可直接复制
程序员架构修炼之道:如何设计出可持续演进的系统架构?
For invoice processing DocuWare, cast off the yoke of the paper and data input, automatic processing all the invoice received
LeetCode——1161. 最大层内元素和
Traceback (most recent call last): File
2022年五面蚂蚁、三面拼多多、字节跳动最终拿offer入职拼多多
代码分析Objective-C中的深拷贝与浅拷贝
[错题]电路维修
LyScript 实现对内存堆栈扫描
二叉搜索树(搜索二叉树)模拟实现(有递归版本)
【TypeScript】为什么要选择 TypeScript?
Traceback (most recent call last): File
MySQL数据库实战(1)