将mysql DATETIME列转换为纪元秒 [英] Convert mysql DATETIME column to epoch seconds

查看:134
本文介绍了将mysql DATETIME列转换为纪元秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列DATETIME格式的mysql datetime.

I have a column mysql datetime that is in DATETIME format.

有没有办法在短短几秒钟内将SELECT插入此列?如果没有,将日期时间格式转换为纪元秒的最佳方法是什么?哪种类型的字段最能捕捉到这一点?

Is there a way to SELECT this column in epoch seconds? If not, what would be the best way of converting the datetime format to epoch seconds? What type of field would be the best to capture this?

推荐答案

使用MySQL的

Use MySQL's UNIX_TIMESTAMP function

这篇关于将mysql DATETIME列转换为纪元秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆