自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL日期的相關(guān)函數(shù)介紹

數(shù)據(jù)庫(kù) MySQL
下文介紹的幾個(gè)函數(shù)都是用于獲得當(dāng)前日期或時(shí)間的MySQL函數(shù),如果您對(duì)MySQL函數(shù)方面感興趣的話,不妨一看。

數(shù)據(jù)庫(kù)中日期和時(shí)間都是很重要的,下面就為您介紹幾個(gè)和MySQL日期時(shí)間相關(guān)的函數(shù),供您參考,希望對(duì)您學(xué)習(xí)MySQL日期時(shí)間方面有所幫助。

獲得當(dāng)前日期(date)函數(shù):curdate()

mysql> select curdate();

+------------+
| curdate() |
+------------+
| 2008-08-08 |
+------------+
其中,下面的兩個(gè)日期函數(shù)等同于 curdate():

current_date()
,current_date

獲得當(dāng)前時(shí)間(time)函數(shù):curtime()

mysql> select curtime();

+-----------+
| curtime() |
+-----------+
| 22:41:30 |
+-----------+
其中,下面的兩個(gè)時(shí)間函數(shù)等同于 curtime():

current_time()
,current_time

獲得當(dāng)前 UTC 日期時(shí)間函數(shù):utc_date(), utc_time(), utc_timestamp()

mysql> select utc_timestamp(), utc_date(), utc_time(), now()

+---------------------+------------+------------+---------------------+
| utc_timestamp() | utc_date() | utc_time() | now() |
+---------------------+------------+------------+---------------------+
| 2008-08-08 14:47:11 | 2008-08-08 | 14:47:11 | 2008-08-08 22:47:11 |
+---------------------+------------+------------+---------------------+
因?yàn)槲覈?guó)位于東八時(shí)區(qū),所以本地時(shí)間 = UTC 時(shí)間 + 8 小時(shí)。UTC 時(shí)間在業(yè)務(wù)涉及多個(gè)國(guó)家和地區(qū)的時(shí)候,非常有用。

以上就是MySQL日期的相關(guān)函數(shù)介紹。

 

【編輯推薦】

帶您深入了解MYSQL Cast函數(shù)

MySQL字符串處理函數(shù)concat_ws()

查看三種MySQL字符集的方法

MySQL外鍵在數(shù)據(jù)庫(kù)中的作用

MySQL外鍵的相關(guān)語(yǔ)法

 

責(zé)任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-10-09 15:46:56

MySQL日期時(shí)間

2010-10-25 17:17:50

Oracle日期轉(zhuǎn)換函

2010-06-18 10:42:51

Linux Acces

2023-03-30 08:00:56

MySQL日期函數(shù)

2010-11-25 11:01:33

MySQL日期函數(shù)

2010-03-19 14:44:30

Python模塊級(jí)函數(shù)

2018-06-12 15:30:07

數(shù)據(jù)庫(kù)MySQLinsert

2010-05-31 14:23:05

MySQL日期函數(shù)

2010-05-27 13:26:20

MySQL日期時(shí)間函數(shù)

2009-02-24 16:17:41

日期時(shí)間函數(shù)

2010-05-21 10:22:37

MySQL數(shù)據(jù)庫(kù)

2010-10-09 14:42:38

MySQL獲取時(shí)間

2020-09-28 08:12:59

CC++時(shí)間

2010-02-01 09:18:49

C++函數(shù)指針

2009-11-18 17:46:58

2009-11-26 10:23:17

2009-11-30 17:16:34

PHP函數(shù)preg_m

2010-03-25 14:13:11

Python運(yùn)行

2009-12-30 10:32:04

擴(kuò)展ADO.NET

2009-12-24 15:04:40

ADO管理
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)