Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Sqldate Mysql Date Expression

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Date Expression

Advertisement
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'.

Mysql Date Expression

     

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)
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 31, 2008

Related Tutorials

Discuss: Mysql Date Expression  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com