当前位置:网站首页>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 .
边栏推荐
- Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
- 1081 rational sum (20 points) points add up to total points
- Detailed explanation of Union [C language]
- 关于Gateway中使用@Controller的问题
- Rough analysis of map file
- Arduino gets the length of the array
- PT OSC deadlock analysis
- js 变量作用域和函数的学习笔记
- gcc 编译选项
- VIM command line notes
猜你喜欢
RT-Thread 线程的时间片轮询调度
I2C总线时序详解
[Red Treasure Book Notes simplified version] Chapter 12 BOM
Page performance optimization of video scene
Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
AMBA、AHB、APB、AXI的理解
Basic operations of databases and tables ----- view data tables
ARM PC=PC+8 最便于理解的阐述
Whistle+switchyomega configure web proxy
Working principle of genius telephone watch Z3
随机推荐
Minio文件下载问题——inputstream:closed
列表的使用
[esp32 learning-1] construction of Arduino esp32 development environment
C language, log print file name, function name, line number, date and time
level16
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
Pytoch temperature prediction
C语言回调函数【C语言】
[esp32 learning-2] esp32 address mapping
Vscode basic configuration
Working principle of genius telephone watch Z3
Générateur d'identification distribué basé sur redis
JS object and event learning notes
Pytorch实现简单线性回归Demo
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
JS variable types and common type conversions
嵌入式启动流程
ESP8266通过arduino IED连接巴法云(TCP创客云)
Raspberry pie tap switch button to use
Who says that PT online schema change does not lock the table, or deadlock