如何在Mysql中将人的日期转换为unix时间戳?

编程入门 行业动态 更新时间:2024-10-27 12:26:55
本文介绍了如何在Mysql中将人的日期转换为unix时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个带有日期字段的表,其中有人的日期,如:'2008-01-08 19:23:32'现在我必须复制该字段加上同一个表的一些其他字段到另一个表,但日期需要在unix时间戳。

mysql中是否有任何函数将人的日期转换为查询本身的unix时间戳?

解决方案

mysql>选择unix_timestamp('2008-01-08 19:23:32'); + --------------------------------------- + | unix_timestamp('2008-01-08 19:23:32')| + --------------------------------------- + | 1199849012 | + --------------------------------------- + 1一行(0.04秒)

在这里找到: www.epochconverter/

I have a table with a date field, having human date in it like: '2008-01-08 19:23:32' Now i have to copy this field plus some other fields of the same table to another table, but date needs to be in unix timestamp.

Is there any function in mysql which converts human date to unix timestamp inside query itself?

解决方案

mysql> select unix_timestamp('2008-01-08 19:23:32'); +---------------------------------------+ | unix_timestamp('2008-01-08 19:23:32') | +---------------------------------------+ | 1199849012 | +---------------------------------------+ 1 row in set (0.04 sec)

found here: www.epochconverter/

更多推荐

如何在Mysql中将人的日期转换为unix时间戳?

本文发布于:2023-10-23 01:36:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519352.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   中将   日期   时间   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!