回覆列表
  • 1 # lanfengkd

    1.1 獲得當前日期+時間(date + time)函式:now()

    除了 now() 函式能獲得當前的日期時間外,MySQL 中還有下面的函式:

    current_timestamp() current_timestamp

    localtime() localtime

    localtimestamp() localtimestamp

    這些日期時間函式,都等同於 now()。鑑於 now() 函式簡短易記,建議總是使用 now() 來替代上面列出的函式。

    1.2 獲得當前日期+時間(date + time)函式:sysdate()

    sysdate() 日期時間函式跟 now() 類似,不同之處在於:now() 在執行開始時值就得到了, sysdate() 在函式執行時動態得到值。

    2. 獲得當前日期(date)函式:curdate()

    其中,下面的兩個日期函式等同於 curdate(): current_date(),current_date

    3. 獲得當前時間(time)函式:curtime()

    其中,下面的兩個時間函式等同於 curtime():current_time(),current_time

    4. 獲得當前 UTC 日期時間函式:utc_date(), utc_time(), utc_timestamp()

  • 中秋節和大豐收的關聯?
  • 郭德綱的德雲社匾牌下為什麼書寫著“曼倩遺風”四個字?