Mysql Time Only

Mysql Time Only is used to return the current time on your current local system.

Mysql Time Only

     

Mysql Time Only is used to return the current time on your current local system.

Understand with Example

We already make you understand on current date and time. The below Query now( ) return you the current date and time  as field name Dateandtime.

Query to find Current time and date:-

 

 

 

 

mysql> select now()as Dateandtime;

Output:-

+---------------------+
| Dateandtime         |
+---------------------+
| 2008-12-23 11:32:39 |
+---------------------+
1 row in set (0.00 sec)

Query to find time only:-

The below Query time(now ( )) return you the current time as field Timeonly. 

mysql> select time(now())as Timeonly;

Output:-

+----------+
| Timeonly |
+----------+
| 11:33:50 |
+----------+
1 row in set (0.00 sec)
Ads