-
Spring Boot Thymeleaf 格式化 OffsetDateTime 时区问题
现象 Spring Boot从PostgreSQL中定时读取数据,createdAt字段是timestamptz类型。 使用Thymeleaf格式化时,如果是Asia/Shanghai(+8)时区,
2026-01-18, Views: 132 , Topics: Thymeleaf Spring Boot 时区
-
PostgreSQL timestamptz 映射 Java OffsetDateTime 注意点
特别注意 如果直接将从PostgreSQL中映射过来的OffsetDateTime字段,如转为LocalDateTime需要特别注意。 OffsetDateTime offsetDateTime =
2024-07-01, Views: 2408 , Topics: PostgreSQL Java 时区
-
Spring Boot OffsetDateTime 返回时转为 String
需求 PostgreSQL中存储的带时区的时间字段,对应Java中为OffsetDateTime,Controller返回时没有对应的处理方法,会抛出异常。 代码 主要是simpleModule.a
2024-04-11, Views: 1983 , Topics: Spring Boot 时区
-
PostgreSQL timestamp 字段转换时区
关键字 at time zone 查看当前数据库默认时区 显示UTC时区。 show time zone; 输出 lite_note=# show time zone; TimeZone
2023-11-12, Views: 2388 , Topics: PostgreSQL 时区
-
PostgreSQL timestamp 与 timestamptz 区别
相同点 都占用8字节。 存储时没有本质区别,都不携带时区信息。 不同点 insert returning和select时返回给客户端数据时不同。 insert时timestamp会直接保存不做
2023-11-11, Views: 2504 , Topics: PostgreSQL Java 时区
-
Docker 同步宿主机时区
方法一 创建容器时指定 -v /etc/localtime:/etc/localtime:ro 方法二 已经运行中的容器 Ubuntu 命令: docker cp -L /usr/share/zo
-
Alpine Linux 更改时区
查看时区 date -R 输出 ~ # date -R Fri, 03 Jun 2022 08:54:26 +0000 设置时区 安装 tzdata 依赖 其实只需要时区的配置文件,安装完成后配
2022-08-04, Views: 6875 , Topics: Alpine Linux 时区
-
PostgreSQL 查看时区
查看当前时区 show timezone; 或者 show time zone; 查看内置时区 所有时区 select * from pg_timezone_names; +8时区 selec
2020-12-30, Views: 13699 , Topics: PostgreSQL 时区
-
Java jar 包启动时指定 JVM 时区
添加启动参数 java -jar -Duser.timezone=GMT+08 xxx.jar
-
MySQL 时间相差了 13 小时
查看时区 show variables like "%time_zone%"; 输出 +------------------+--------+ | Variable_name | Va