MySQL

MySQL Examples and Tutorials

MySQL LOCALTIME() and NOW() Functions – Displaying the current date and time

In this tutorial, we will study the MySQL LOCALTIME() and NOW() functions. So far we have seen the CURDATE() and the CURTIME() functions which return the current date and current time respectively. What if we need a function that returns the current date and time together? This is where the LOCALTIME() and NOW() functions come …

MySQL LOCALTIME() and NOW() Functions – Displaying the current date and time Read More »

MySQL FROM_DAYS() and TO_DAYS()

In this tutorial, we will learn about the MySQL FROM_DAYS() and TO_DAYS() functions. The MySQL FROM_DAYS() function returns the date value from a given numeric date value. The specified numeric date value is divided by 365. The resulting remainder is added to the year 0 and accordingly, the date value is returned. I know it …

MySQL FROM_DAYS() and TO_DAYS() Read More »

MySQL WEEKDAY() Function

In this tutorial, we will study the MySQL WEEKDAY() function. A week has seven days. Suppose you want to find the weekday number of any given date. This is where we use the MySQL WEEKDAY() function. WEEKDAY() function is used to return a weekday number (called weekday index) for a given date. It treats Monday …

MySQL WEEKDAY() Function Read More »