The Tutorial illustrate an example from 'Mysql Date Expression'. To understand this example we use current_timestamp query that return you a format 'YYYY-MM-DD' and 'HH.MM.SS'. Timestamp columns are displayed in the same format as Datetime format.
Query:-
| mysql> select current_timestamp() as Date; |
Output:-
| +---------------------+ | Date | +---------------------+ | 2008-12-19 15:38:44 | +---------------------+ 1 row in set (0.00 sec) |
Query:-
The now ( ) Query is used to return the current date and time as Date fieldname.
| mysql> select now() as Date; |
Output:-
| +---------------------+ | Date | +---------------------+ | 2008-12-19 15:39:37 | +---------------------+ 1 row in set (0.00 sec) |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Mysql Date Expression
Post your Comment