LAST_DAY() Examples – MySQL

When using MySQL, you can use the LAST_DAY() function to return the last day of a given month.

You can provide the current date, or you can provide another specified date (for example, a date from a column in a database), and LAST_DAY() will return the last day of the month for that date.

Read more

HOUR() Examples – MySQL

The MySQL HOUR() function is used to return the hour component from a time value.

The return value for a time-of-day value will be between 0 and 23, however the range returned by this function could be much larger, due to the fact that a time data type isn’t limited to just a time of day (it can also be used to represent elapsed time or a time interval between two events). This means that the returned value could be greater than 24 hours or even a negative value.

Read more

FROM_UNIXTIME() Examples – MySQL

The MySQL FROM_UNIXTIME() function enables you to return a date representation of a Unix timestamp.

More specifically, it returns the Unix timestamp as a value in ‘YYYY-MM-DD HH:MM:SS’ or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.

Read more

UNIX_TIMESTAMP() Examples – MySQL

In MySQL, you can use the UNIX_TIMESTAMP() function to return a Unix timestamp. A Unix timestamp is the number of seconds that have elapsed since ‘1970-01-01 00:00:00’ UTC.

You can use this function to return a Unix timestamp based on the current date/time or another specified date/time.

Read more