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



Home Sql Sqldate Mysql Date and Time

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Date and Time

Advertisement
The Tutorial illustrate an example, that help in understanding datetime. In this Tutorial ,we illustrate an example that help you in writing a date time format Query in different ways.

Mysql Date and Time

     

The Tutorial illustrate an example, that help in understanding datetime. In this Tutorial ,we illustrate an example that help you in writing a date time format Query in different ways.

now ( )  :The below Query return you the current date in yyyy-mm-dd and time in hh:mm:ss.

Query for displaying current date and time:-

 

 

 

 

 

mysql> select now()as DateandTime;

Output:-

+---------------------+
| DateandTime |
+---------------------+
| 2008-12-20 12:19:07 |
+---------------------+
1 row in set (0.00 sec)

Query for extracting date from datetime:-

The given below Query return you the current date.

mysql> select day(now())as TodayDate;

Output:-

+-----------+
| TodayDate |
+-----------+
| 20 |
+-----------+
1 row in set (0.00 sec)
Advertisement

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 and Time  

Post your Comment


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