赞
踩
SELECT FROM_UNIXTIME(timestamp_column) AS converted_date FROM your_table;
SELECT UNIX_TIMESTAMP(date_column) AS converted_timestamp FROM your_table;
SELECT TO_DATE(timestamp_column, 'YYYY-MM-DD HH24:MI:SS') AS converted_date FROM your_table;
SELECT TO_CHAR(date_column, 'YYYY-MM-DD HH24:MI:SS') AS converted_timestamp FROM your_table;
SELECT CONVERT(DATE, DATEADD(SECOND, timestamp_column, '19700101')) AS converted_date FROM your_table;
SELECT DATEDIFF(SECOND, '19700101', date_column) AS converted_timestamp FROM your_table;
SELECT TO_TIMESTAMP(timestamp_column) AS converted_date FROM your_table;
SELECT EXTRACT(EPOCH FROM date_column) AS converted_timestamp FROM your_table;
SELECT FROM_UNIXTIME(timestamp_column) AS converted_date FROM your_table;
SELECT UNIX_TIMESTAMP(date_column) AS converted_timestamp FROM your_table;
SELECT DATE_FORMAT(datetime_column, '%Y-%m-%d %H:%i:%s') AS converted_string FROM your_table;
SELECT STR_TO_DATE('2023-11-23 12:30:45', '%Y-%m-%d %H:%i:%s') AS converted_datetime FROM your_table;
SELECT TO_CHAR(datetime_column, 'YYYY-MM-DD HH24:MI:SS') AS converted_string FROM your_table;
SELECT TO_DATE('2023-11-23 12:30:45', 'YYYY-MM-DD HH24:MI:SS') AS converted_datetime FROM dual;
SELECT CONVERT(VARCHAR, datetime_column, 120) AS converted_string FROM your_table;
SELECT CONVERT(DATETIME, '2023-11-23 12:30:45', 120) AS converted_datetime FROM your_table;
SELECT TO_CHAR(datetime_column, 'YYYY-MM-DD HH24:MI:SS') AS converted_string FROM your_table;
SELECT TO_TIMESTAMP('2023-11-23 12:30:45', 'YYYY-MM-DD HH24:MI:SS') AS converted_datetime FROM your_table;
SELECT DATE_FORMAT(datetime_column, 'yyyy-MM-dd HH:mm:ss') AS converted_string FROM your_table;
SELECT TO_TIMESTAMP('2023-11-23 12:30:45', 'yyyy-MM-dd HH:mm:ss') AS converted_datetime FROM your_table;
SELECT DATE_FORMAT(date_column, '%Y-%m-%d') AS converted_string FROM your_table;
SELECT STR_TO_DATE('2023-11-23', '%Y-%m-%d') AS converted_date FROM your_table;
SELECT TO_CHAR(date_column, 'YYYY-MM-DD') AS converted_string FROM your_table;
SELECT TO_DATE('2023-11-23', 'YYYY-MM-DD') AS converted_date FROM dual;
SELECT CONVERT(VARCHAR, date_column, 23) AS converted_string FROM your_table;
SELECT CONVERT(DATE, '2023-11-23') AS converted_date FROM your_table;
SELECT TO_CHAR(date_column, 'YYYY-MM-DD') AS converted_string FROM your_table;
SELECT TO_DATE('2023-11-23', 'YYYY-MM-DD') AS converted_date FROM your_table;
SELECT DATE_FORMAT(date_column, 'yyyy-MM-dd') AS converted_string FROM your_table;
SELECT TO_DATE('2023-11-23', 'yyyy-MM-dd') AS converted_date FROM your_table;
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-a7DPp8J0-1714518375729)]
[外链图片转存中…(img-2fyKlEXI-1714518375730)]
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。