MySQL database gets system time, year, month, day single fetch
Get current system date Time: Select Sysdate () as System datetime;
Get current system Month Day: Select Current_date as Month day;
Gets the current system year: Select Year (current_date) as;
Gets the current system month: Select Month (current_date) as month;
Get current system date: Select Day (current_date) as date;
Get current system time: Select Time (Sysdate ()) as system times;
Get current system hour: Select HOUR (Sysdate ()) as System hour;
Get current system minutes: Select MINUTE (Sysdate ()) as system minutes;
Get current system seconds: Select SECOND (Sysdate ()) as system seconds;
Gets the current system millisecond: Select Microsecond (Sysdate ()) as system seconds;
MySQL database gets system time, year, month, day single fetch
Get system time in MySQL database, year, month, day
Select curdate(); --Get the current date
< Span class= "Sql1-space" >select last_day ( curdate ()); --Gets the last day of the month.
< Span class= "sql1-function" >select DATE_ADD (curdate (), Interval -day (curdate ()) + 1day -Get the first day of the month
select date_add ( curdate ()-day (curdate ()) + 1,interval 1 month --Get the first day of next month
Select DATEDIFF(Date_add(Curdate()-Day(Curdate())+1,Interval 1 month ), date_add (curdate (), interval -day (curdate () +1 Day from dual; Span class= "sql1-comment" > --Get the number of days in the current month
Select Curtime () ---get current system time
Select Sysdate (), Current_timestamp (), now (), localtime (), L Ocaltimestamp () ---- Get current system date + time
MySQL single get system time, year, month, day