海詩網(wǎng) 知識百科 mysql(mysql下載)

mysql(mysql下載)

mysql, mysql中的date函數(shù)是什么,如何使用?不知道小伙伴們今天來看看邊肖的分享吧!

1.日期功能介紹:

MySQL數(shù)據(jù)庫Date () date函數(shù),用于查詢MySQL數(shù)據(jù)庫中的當(dāng)前日期和時間。

2.用法:

獲取當(dāng)前時間:

MySQLselectcurrent_timestamp();

+---------------------+

|current_timestamp()|

+---------------------+

|2010-01-1821:24:37|

+---------------------+

1rowinset(0.00sec)

MySQLselectcurrent_date();

+----------------+

|current_date()|

+----------------+

|2010-01-18|

+----------------+

1rowinset(0.00sec)

MySQLselectcurrent_time();

+----------------+

|current_time()|

+----------------+

|21:24:46|

+----------------+

1rowinset(0.00sec)

mysql下載

Unix時間:

MySQLselectunix_timestamp();

+------------------+

|unix_timestamp()|

+------------------+

|1263821184|

+------------------+

1rowinset(0.00sec)

MySQLselectfrom_unixtime(1263821182);

+---------------------------+

|from_unixtime(1263821182)|

+---------------------------+

|2010-01-1821:26:22|

+---------------------------+

1rowinset(0.00sec)

大約時間:

MySQLselectdate_add(current_timestamp,interval1day);

+---------------------------------------------+

|date_add(current_timestamp,interval1day)|

+---------------------------------------------+

|2010-01-1921:27:53|

+---------------------------------------------+

1rowinset(0.00sec)

MySQLselectdate_add(current_time,interval1day);

+----------------------------------------+

|date_add(current_time,interval1day)|

+----------------------------------------+

|NULL|

+----------------------------------------+

1rowinset,1warning(0.00sec)

MySQLselectdate_add(current_date,interval1day);

+----------------------------------------+

|date_add(current_date,interval1day)|

+----------------------------------------+

|2010-01-19|

+----------------------------------------+

1rowinset(0.00sec)

MySQLselectdate_sub(current_timestamp,interval1day);

+---------------------------------------------+

|date_sub(current_timestamp,interval1day)|

+---------------------------------------------+

|2010-01-1721:28:41|

+---------------------------------------------+

1rowinset(0.00sec)

MySQLselectdate_sub(current_date,interval1day);

+----------------------------------------+

|date_sub(current_date,interval1day)|

+----------------------------------------+

|2010-01-17|

+----------------------------------------+

1rowinset(0.00sec)

MySQLselectdate_sub(current_time,interval1day);

+----------------------------------------+

|date_sub(current_time,interval1day)|

+----------------------------------------+

|NULL|

+----------------------------------------+

1rowinset,1warning(0.00sec)

mysql下載

時間間隔:

MySQLselectdatediff(2010-01-18,2010-01-17);

+-------------------------------------+

|datediff(2010-01-18,2010-01-17)|

+-------------------------------------+

|1|

+-------------------------------------+

1rowinset(0.00sec)

MySQLselecttimediff(2010-01-1812:00,2010-01-1711:00);

+-------------------------------------------------+

|timediff(2010-01-1812:00,2010-01-1711:00)|

+-------------------------------------------------+

|25:00:00|

+-------------------------------------------------+

1rowinset(0.00sec)

時間轉(zhuǎn)換:

MySQLselecttime_to_sec(25:00:00);

+-------------------------+

|time_to_sec(25:00:00)|

+-------------------------+

|90000|

+-------------------------+

1rowinset(0.00sec)

MySQLselectsec_to_time(90000);

+--------------------+

|sec_to_time(90000)|

+--------------------+

|25:00:00|

+--------------------+

1rowinset(0.00sec)

mysql,以上就是本文為您收集整理的mysql最新內(nèi)容,希望能幫到您!更多相關(guān)內(nèi)容歡迎關(guān)注。

本文來自網(wǎng)絡(luò),不代表海詩網(wǎng)立場,轉(zhuǎn)載請注明出處:http://x91880.com/n/169315.html
      

多邊形套索工具怎么結(jié)束(多邊形套索工具為什么按鍵后無法點擊下一點)

發(fā)表回復(fù)
聯(lián)系我們
聯(lián)系我們

在線咨詢: QQ交談

郵箱: 3587015498@qq.com

工作時間:周一至周五,9:00-17:30,節(jié)假日休息

關(guān)注微信
微信掃一掃關(guān)注我們
微信掃一掃關(guān)注我們
關(guān)注微博
返回頂部