当前位置:网站首页>MySQL timestamp format conversion date format string
MySQL timestamp format conversion date format string
2022-06-24 16:07:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
1. Test table structure
CREATE TABLE `timestamp_string_change` (
`id` int NOT NULL AUTO_INCREMENT,
`up_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;2. mysql Timestamp format to string
Method 1 :
select STR_TO_DATE(tsc.up_time, '%Y-%m-%d %H:%i:%s' ) as up_time from timestamp_string_change tsc Method 2:
select from_unixtime(unix_timestamp(up_time), '%Y-%m-%d %H:%i:%s' ) as up_time from timestamp_string_change notes : Method 2 when , We need to use it first. unix_timestamp() Method to convert data to timestamp format , Reuse from_unixtime() Method to convert a timestamp to a custom format time string . Direct use from_unixtime() Method NULL.
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151936.html Link to the original text :https://javaforall.cn
边栏推荐
- Global and Chinese market of training dance clothes 2022-2028: Research Report on technology, participants, trends, market size and share
- 【附下载】汉化版Awvs安装与简单使用
- Introduction to new features of ECMAScript 2019 (ES10)
- Here comes Wi Fi 7. How strong is it?
- Three solutions for Jenkins image failing to update plug-in Center
- Istio FAQ: region awareness does not take effect
- ThinkPHP 漏洞利用工具
- Understanding openstack network
- Two problems of qtreewidget returning as DLL in singleton mode
- How to expand disk space on AWS host
猜你喜欢

Here comes Wi Fi 7. How strong is it?

Apple is no match for the longest selling mobile phone made in China, and has finally brought back the face of the domestic mobile phone

60 divine vs Code plug-ins!!

60 个神级 VS Code 插件!!

Cap: multiple attention mechanism, interesting fine-grained classification scheme | AAAI 2021

Solution of intelligent all in one machine in expressway service area
![Software test [high frequency] interview questions sorted out by staying up late (latest in 2022)](/img/33/2c2256fd98b908ddaf5573f644ad7f.png)
Software test [high frequency] interview questions sorted out by staying up late (latest in 2022)

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)

Logging is not as simple as you think

ZOJ——4104 Sequence in the Pocket(思维问题)
随机推荐
基于STM32的MD5校验
MongoDB入門實戰教程:學習總結目錄
sql 多表更新数据非常慢
D. Solve The Maze(思维+bfs)Codeforces Round #648 (Div. 2)
Global and Chinese market of insect proof clothing 2022-2028: Research Report on technology, participants, trends, market size and share
存在安全隐患 部分冒险家混动版将召回
2021-05-04: given a non negative integer C, you need to judge whether there are two integers a and B, so that a*a+b*b=c.
Here comes Wi Fi 7. How strong is it?
Detailed explanation of estab of Stata regression table output
HMM to CRF understanding and learning notes
The equipment is connected to the easycvr platform through the national standard gb28181. How to solve the problem of disconnection?
Global and Chinese market of inverted syrup 2022-2028: Research Report on technology, participants, trends, market size and share
2021-05-03: given a non negative integer num, how to avoid circular statements,
[application recommendation] the hands-on experience and model selection suggestions of apifox & apipost in the recent fire
Nature publishes significant progress in quantum computing: the first quantum integrated circuit implementation in history
Golang+redis reentrant lock
Paper: Google TPU
Pytorch 转置卷积
Learning these 10 kinds of timed tasks, I'm a little floating
安裝ImageMagick7.1庫以及php的Imagick擴展