zoukankan      html  css  js  c++  java
  • MySQL时间戳和时间格式转换函数

    MySQL时间戳和时间格式转换函数:unix_timestamp and from_unixtime


    unix_timestamp将时间转化成时间戳格式。
    from_unixtime将时间戳转化成时间格式。


    mysql> select unix_timestamp(now());
    +-----------------------+
    | unix_timestamp(now()) |
    +-----------------------+
    |            1251884321 |
    +-----------------------+
    1 row in set (0.00 sec)

    mysql> select from_unixtime(1251884321);
    +---------------------------+
    | from_unixtime(1251884321) |
    +---------------------------+
    | 2009-09-02 17:38:41       |
    +---------------------------+
    1 row in set (0.00 sec)





  • 相关阅读:
    第三次作业
    第二次作业
    第一次作业
    实验二
    第一次试验
    第五次作业
    第四次作业
    第三次作业
    第二次作业
    第一次作业
  • 原文地址:https://www.cnblogs.com/jeffen/p/5965245.html
Copyright © 2011-2022 走看看