By using these mysql functions you can query the current time, current date, current time_stamp
The Below is the examples:
curdate() or current_date() :-
curtime() or current_time() :-
now():-
SELECT substring("scott",2,3)
The Below is the examples:
curdate() or current_date() :-
To get the current date information of server.
SELECT current_date();
Output:
current_date |
---|
2015-03-20 |
To get the current time information of server
SELECT current_time();
Output:
current_time() |
---|
21:57:50 |
Current_timestamp() :-
To get the current_timestamp date and time
SELECT current_timestamp()
current_timestamp() |
---|
2015-03-20 21:59:47 |
now():-
SELECT now()
It is same as previous current_timestamp
now() |
---|
2015-03-20 22:01:04 |
SELECT substring("scott",2,3)
output :
substring("scott",2,3) |
---|
cot |
0 comments:
Post a Comment