获得当前日期+时间(date + time)1.1 函数:now()
相关函数:current_timestamp(),localtime(),localtimestamp()
举例说明:
2. 获得当前日期(date)
函数:curdate()
相关函数:current_date(),current_date
举例说明:
3. 获得当前时间(time)
函数:curtime()
相关函数:current_time(),current_time
举例说明
4. MySQL dayof…
函数:dayofweek(), dayofmonth(), dayofyear()分别返回日期参数,在一周、一月、一年中的位置。
举例说明
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 天

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version