WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

SQL NOW() Function


NOW () function

NOW () function returns the date and time of the current system.

SQL NOW () syntax

SELECT NOW () FROM table_name;


Demo database

In this welookups, we will use the welookups sample database.

Here is the data from the "Websites" table:

+----+--------------+---------------------------+-------+---------+
| id | name         | url                       | alexa | country |
+----+--------------+---------------------------+-------+---------+
| 1  | Google       | https://www.google.com/  | 1     | USA     |
| 2  | zomato     |   https  :   //www.zomato.com/| 13 | IN |  
  |     3     |      welookups     |   http  :   /www.welookups.com/| 4689 | IN |  
  |     4     |     Yahoo           | http://Yahoo.com/       | 20    | IN      |
| 5  | Facebook     | https://www.facebook.com/| 3     | USA     |
| 7  | stackoverflow | http://stackoverflow.com/|   0 | IND     |
+----+---------------+---------------------------+-------+---------+


SQL NOW () instance

The following SQL statement selects the name, url, and date from the "Websites" table:

Example

SELECT name, url, Now () AS date
FROM Websites;

The result of executing the above SQL is as follows: