SYSDATE() Function in MySQL

SYSDATE() Function in MySQL

How to use MySQL sysdate() function. In this tutorial, we would love to share with you how to use sysdate function with example. Also, we will explain sysdate() function definition, syntax and various examples.

The MySQL SYSDATE() function is similar to NOW() but with a small difference.

MySQL SYSDATE() function

Definition:- SYSDATE() function is a built-in MySQL function, which is used to get the current date and time.


MySQL sysdate() format :- This function will return date time in the format “YYYY-MM-DD HH:MM:SS” (string) or as YYYYMMDDHHMMSS (numeric).



argument:- It is an optional parameter. It specifies the fractional seconds precision for the return value.

Example 1 – Basic Usage

Here, we will take an example for demonstrating.


The output of the above query is the following:

 | SYSDATE()           |
 | 2020-01-04 11:18:09 |

Example 2 – With Fractional Seconds Precision

Here we will take a second example with fractional seconds precision parameters.


The output of the above query is the following:

 | SYSDATE(4)                 |
 | 2020-01-04 11:19:45.9179   |

Example 3 – With Numeric Context

Here we will take a third example with a numeric context for demonstration.


You can also add in mysql sysdate() +1, sysdate() +7, sysdate() +15, sysdate() +30, etc.

The output of the above query is the following:

 | SYSDATE() + 1              |
 | 20200104112060             |


  1. MySQL SYSDATE() returns the time at which it executes.
  2. MySQL NOW() returns the time at which the statement started executing.

Recommended Tutorial

  1. MySQL Tutorial With Examples
  2. PHP Date and Time functions tutorial
  3. MySQL: DATE() And TIME() Functions Tutorial


My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Javascript, JQuery, Laravel, Livewire, Codeigniter, Vue JS, Angular JS, React Js, WordPress, and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *