How SYSDATE() Works in MariaDB

In MariaDB, SYSDATE() is a built-in date and time function that returns the current date and time.

It returns the time that the function was executed (which could be different to the time that the statement was executed).

The return value is returned in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.

The return value is expressed in the current time zone.

You also have the option of specifying the microsecond precision.

Continue reading

How FROM_UNIXTIME() Works in MariaDB

In MariaDB, FROM_UNIXTIME() is a built-in date and time function that returns a datetime value based on a given unix timestamp.

You pass the unix timestamp to the function when you call it.

The result is returned in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.

The value is expressed in the current time zone.

Continue reading