mysql獲取當(dāng)前時間戳 mysql如何獲取當(dāng)前時間?
mysql如何獲取當(dāng)前時間?1.1獲取當(dāng)前日期時間函數(shù):now()除了函數(shù)now(),MySQL中還有以下函數(shù):current imestamp()current這些日期時間函數(shù)等價(jià)于now()。由于
mysql如何獲取當(dāng)前時間?
1.1獲取當(dāng)前日期時間函數(shù):now()
除了函數(shù)now(),MySQL中還有以下函數(shù):
current imestamp()current這些日期時間函數(shù)等價(jià)于now()。由于now()函數(shù)很短而且容易記住,因此建議您始終使用now()而不是上面列出的函數(shù)。
1.2獲取當(dāng)前日期時間函數(shù):sysdate()
sysdate()日期時間函數(shù)類似于now(),區(qū)別在于now()的值是在執(zhí)行開始時獲取的,sysdate()的值是在函數(shù)執(zhí)行過程中動態(tài)獲取的。
2. 獲取當(dāng)前日期函數(shù):current()
其中以下兩個日期函數(shù)等效于current():currentudate(),currentuget the current time函數(shù):current()],其中,以下兩個時間函數(shù)等效于current():currentutime(),currentuget當(dāng)前UTC日期時間函數(shù):UTCudate(),UTCutime(),UTCutimestamp()