当前位置:网站首页>MySQL time, time zone, auto fill 0
MySQL time, time zone, auto fill 0
2022-07-06 12:16:00 【A pole】
Database time update problem 2022/4/13
When the database updates user information , The registration time will be updated every time , I'm really confused about this wave .
At first I thought it was mybatis By the way, I updated the registration time , Then I checked the code , No problem found , open mybatis Look at the log ,sql The statements are also correct , I don't see the code that updates the registration time at all .
Think about it. , Maybe it's the database . It is found that the registration time field is checked Update... Based on the current timestamp The option to , Suddenly understand , The original option is that this field will be updated every time the content is updated . Test the code after canceling , Everything is all right .
Database time zone error 2022/4/20
Today, I debugged an interface , Involving time , I am from Java Get the current time and then go to the database ( In fact, I think using the database now
It's fine too ), Then something went wrong , The time saved is several hours slower than the actual time .
I think about it , Will not be new Timestamp(System.currentTimeMillis());
It's a matter of time for this code to get , Tested decisively , Discovery is not its problem , That must be the problem of the database , But I think the time when the database automatically updates the timestamp is correct . Think about it. , Maybe when you turn around , Time zone problem .
Written before yaml When configuring a file , Always follow the teacher's writing , That's what the teacher wrote jdbc:mysql://127.0.0.1:3306/blog?serverTimezone=UTC
, It turned out that I was 100 degrees , good heavens , This time zone is the universal time , It's slower than Beijing 8 Hours , Change to serverTimezone=Asia/Shanghai
It's settled. .
Database population 0 2022/4/20
stay mysql5.6 in ,int And other digital types can be selected fill 0
.
fill 0 It does not mean that the default value is 0, But to On display , Fill to the left by default 0, namely 20 It will be displayed. 0000000020 , Of course, on the left 0 Not necessarily as much as I wrote , Here I am just making an analogy .
If you don't want to automatically fill so many 0, Cancel... Directly
Fill in zero
This is the option .
边栏推荐
- 程序员老鸟都会搞错的问题 C语言基础 指针和数组
- Types de variables JS et transformations de type communes
- The dolphin scheduler remotely executes shell scripts through the expect command
- JS变量类型以及常用类型转换
- Gateway 根据服务名路由失败,报错 Service Unavailable, status=503
- C语言,log打印文件名、函数名、行号、日期时间
- JS variable types and common type conversions
- 嵌入式启动流程
- Comparaison des solutions pour la plate - forme mobile Qualcomm & MTK & Kirin USB 3.0
- RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
猜你喜欢
基於Redis的分布式ID生成器
ES6 grammar summary -- Part I (basic)
Working principle of genius telephone watch Z3
[Red Treasure Book Notes simplified version] Chapter 12 BOM
程序员老鸟都会搞错的问题 C语言基础 指针和数组
Arduino uno R3 register writing method (1) -- pin level state change
Arm pc=pc+8 is the most understandable explanation
Detailed explanation of Union [C language]
Understanding of AMBA, AHB, APB and Axi
JS变量类型以及常用类型转换
随机推荐
arduino获取随机数
[esp32 learning-1] construction of Arduino esp32 development environment
ESP8266通过arduino IED连接巴法云(TCP创客云)
RT-Thread 线程的时间片轮询调度
RT-Thread API参考手册
优先级反转与死锁
@Autowired 和 @Resource 的区别
RT-Thread的main线程“卡死”的一种可能原因及解决方案
map文件粗略分析
Walk into WPF's drawing Bing Dwen Dwen
Several declarations about pointers [C language]
ESP8266使用arduino连接阿里云物联网
Types de variables JS et transformations de type communes
Embedded startup process
I2C bus timing explanation
MySQL时间、时区、自动填充0的问题
IOT system framework learning
Unit test - unittest framework
inline详细讲解【C语言】
JS object and event learning notes