×ðÁú¿­Ê±¹ÙÍøµÇ¼

mysqlÖÐÄ¿½ñÈÕÆÚºÍʱ¼äµÄº¯Êý

mysql ÖлñÈ¡Ä¿½ñÈÕÆÚºÍʱ¼äµÄº¯Êý¹²ÓÐÈý¸ö£º1. now() º¯Êý£º·µ»ØÄ¿½ñÈÕÆÚºÍʱ¼ä£¬ÃûÌÃΪ ‘yyyy-mm-dd hh:mm:ss’£»2. curdate() º¯Êý£º·µ»ØÄ¿½ñÈÕÆÚ£¬ÃûÌÃΪ ‘yyyy-mm-dd’£»3. curtime() º¯Êý£º·µ»ØÄ¿½ñʱ¼ä£¬ÃûÌÃΪ ‘hh:mm:ss’¡£

MySQL ÖлñÈ¡Ä¿½ñÈÕÆÚºÍʱ¼äµÄº¯Êý

NOW() º¯Êý

NOW() º¯Êý·µ»ØÄ¿½ñÈÕÆÚºÍʱ¼ä£¬ÃûÌÃΪ ‘YYYY-MM-DD HH:MM:SS’¡£

Àý×Ó£º

SELECT NOW();

µÇ¼ºó¸´ÖÆ

Ч¹û£º

2023-03-08 14:32:31

µÇ¼ºó¸´ÖÆ

CURDATE() º¯Êý

CURDATE() º¯Êý·µ»ØÄ¿½ñÈÕÆÚ£¬ÃûÌÃΪ ‘YYYY-MM-DD’¡£

Àý×Ó£º

SELECT CURDATE();

µÇ¼ºó¸´ÖÆ

Ч¹û£º

2023-03-08

µÇ¼ºó¸´ÖÆ

CURTIME() º¯Êý

CURTIME() º¯Êý·µ»ØÄ¿½ñʱ¼ä£¬ÃûÌÃΪ ‘HH:MM:SS’¡£

Àý×Ó£º

SELECT CURTIME();

µÇ¼ºó¸´ÖÆ

Ч¹û£º

14:32:31

µÇ¼ºó¸´ÖÆ

ÆäËûÓ÷¨

³ýÁ˵¥¶ÀʹÓÃÕâЩº¯Êý£¬»¹¿ÉÒÔÓëÆäËûº¯ÊýÍŽáʹÓã¬ÀýÈ磺

DATE_ADD()£ºÌí¼ÓÖ¸¶¨ÌìÊý»òʱ¼äµ½Ä¿½ñÈÕÆÚ»òʱ¼ä¡£

DATE_SUB()£º´ÓÄ¿½ñÈÕÆÚ»òʱ¼äÖмõÈ¥Ö¸¶¨ÌìÊý»òʱ¼ä¡£

DATE_FORMAT()£º½«ÈÕÆÚ»òʱ¼äת»»Îª²î±ðµÄÃûÌá£

×¢ÖØ£º

ÕâЩº¯Êý·µ»ØЧÀÍÆ÷ÉϵÄÄ¿½ñÈÕÆÚºÍʱ¼ä£¬¶ø²»ÊÇ¿Í»§¶ËÅÌËã»úÉϵÄÈÕÆÚºÍʱ¼ä¡£

ÒÔÉϾÍÊÇmysqlÖÐÄ¿½ñÈÕÆÚºÍʱ¼äµÄº¯ÊýµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ