dongqing344716 2019-04-09 16:36
浏览 304

输入时间戳和UTC

I have a MySql database. In a column, I set Structure Type timestamp. I need that column to know at what day and hour the user updated their information. But I realize the database store the time zone from where I am (Europe) that is UTC+2. That could cause problems with users in different time zones. It would be better to store a universal time, that is UTC.

Can MySql automatically register the timestamp UTC?

I can change the column type from timestamp to date. Each time that the user updates his information I can get the UTC and update that information manually.

$utc = gmdate("Y-m-d H:i:s");

So, I can update the UTC time every time I make an update. But I was expecting that MySql would provide a column type that could do that automatically. Is this possible?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 求数学坐标画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站