Published on: 01 September, 2013

SQL NOW()

Tumblr Digg Google Plus

The SQL NOW() function is used to return current database server date and time.

Example Customer Table

The following data table is for example only.

ID Name Age
1 Thomas Anderson 45
2 Andrew Golden 38
3 Ken Tom 30
4 Andrew Golden 36
5 Timothy Kirk 32
6 Kelly Smith 39

Example of Running SQL Query

SELECT ID, Name, Age, NOW() AS Date
FROM Customers

After running the above query, it will return the following result.

ID Name Age Date
1 Thomas Anderson 45 2013-09-24 11:47:00.157
2 Andrew Golden 38 2013-09-24 11:47:00.157
3 Ken Tom 30 2013-09-24 11:47:00.157
4 Andrew Golden 36 2013-09-24 11:47:00.157
5 Timothy Kirk 32 2013-09-24 11:47:00.157
6 Kelly Smith 39 2013-09-24 11:47:00.157

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.