亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

MySQL 日期時(shí)間函數(shù)常用總結(jié)

 更新時(shí)間:2012年06月12日 17:30:56   作者:  
MySQL 日期時(shí)間函數(shù)常用總結(jié),需要的朋友可以參考下

 獲得當(dāng)前日期+時(shí)間(date + time)1.1    函數(shù):now()

     相關(guān)函數(shù):current_timestamp(),localtime(),localtimestamp()

     舉例說(shuō)明:



        2. 獲得當(dāng)前日期(date)

     函數(shù):curdate()

     相關(guān)函數(shù):current_date(),current_date

     舉例說(shuō)明:



        3. 獲得當(dāng)前時(shí)間(time)

    函數(shù):curtime()

     相關(guān)函數(shù):current_time(),current_time

    舉例說(shuō)明


     

        4. MySQL dayof… 

    函數(shù):dayofweek(), dayofmonth(), dayofyear()分別返回日期參數(shù),在一周、一月、一年中的位置。

    舉例說(shuō)明

    set @dt = '2008-08-08';

    select dayofweek(@dt); -- 6

    select dayofmonth(@dt); -- 8

    select dayofyear(@dt); -- 221

    日期‘2008-08-08′ 是一周中的第6 天(1 = Sunday, 2 = Monday, …, 7 = Saturday)

    一月中的第8 天;一年中的第221 天

    相關(guān)文章

    最新評(píng)論