MySQL:- Functions

Background

Wanted to cover a couple of MySQL System Functions.

 

System Functions

 

Category Use Function Name Syntax Sample Data
Date and Time Functions
Current Date
CurDate curdate() 2020-08-24
current_date current_date() 2020-08-24
Current Time
CurTime curtime() 09:27:01
current_time current_time() 09:27:01
Day Function
Day of the Month day day(curdate()) 24
Day Name dayname dayname(curdate()) Monday
Day of the Week dayofweek dayofweek(curdate()) 2
Day of the Year dayofyear dayofyear(curdate()) 237
Last Day of the Month last_day last_day(curdate()) 2020-08-31
Week Function
Week of the Year week week(curdate()) 34
Day of the Week weekday weekday(curdate()) 0
Month Function
Month of the Year as Number month month(curdate()) 8
Month of the Year as Month Name monthname monthname(curdate()) August
Year Function
Year year year(curdate()) 2020
Versioning
Version Version version() 8.0.21
System
Hostname hostname @@hostname dev
User Authentication
User
user user user dave
System_User System_User system_User dave

 

 

References

  1. MySQL
    • Date and Time Functions

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s