惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
Vercel News
Vercel News
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
Y
Y Combinator Blog
F
Full Disclosure
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
S
SegmentFault 最新的问题
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
T
Threatpost
GbyAI
GbyAI
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
L
LangChain Blog
T
Tenable Blog
C
Cisco Blogs
T
Threat Research - Cisco Blogs
Google Online Security Blog
Google Online Security Blog

博客园 - 爱跳舞的程序员

freemarker对数字格式的处理 FilePathJaxbUtil(xml文件转JavaBean对象工具) PL_SQL常用快捷键 将博客搬至CSDN css+jquery右下角弹框提示框(工作需要就开发调式了) textarea文本居中的问题 bat批量复制文件(一键打包更新代码,避免手动一个个复制) url特殊字符传递参数解决方法(特指超链接) js 拼接字符串带变量(js方法参数单双引号拼接的问题记录) 表单提交由submit改为异步的方式 解决复制select下拉框时 值没法复制的问题 Jquery操作select汇总 博文阅读密码验证 - 博客园 ztree树添加右击菜单 ligerLayout布局(左右分栏) 模糊查询+首字母查询组合框 displayTag解决中文排序、和翻页查询出错的问题 jquery之ztree树入门(输出最简单树形) java 根据word xml模板生成word(个人v2版本)
freemarker对日期的处理
爱跳舞的程序员 · 2025-07-17 · via 博客园 - 爱跳舞的程序员
ftl文件中使用了下面这些都没解决
       
<#-- <w:t><#if bzsj??>${(bzsj ?datetime)?string('yyyy-MM-dd hh:mm')}</#if></w:t>-->
<#-- <w:t>${bzsj?string('yyyy-MM-dd hh:mm')}</w:t>-->
<#--<w:t>${bzsj?number_to_datetime}</w:t>-->
<#-- <w:t>${(bzsj?datetime)?string("yyyy-MM-dd HH:mm:ss")}</w:t>-->

最终解决方案,在创建gson对象时,设置好时间格式
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd HH:mm") // 设置全局日期格式
.create();

然后直接

<#if bzsj??>${bzsj}</#if> 即可