Home Sql Sqldate Mysql Date and Time



Mysql Date and Time
Posted on: December 31, 2008 at 12:00 AM
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)

Related Tags for Mysql Date and Time:
querydatetimeormdateformtimediffhelpformattutorialriathisifforexamplewritingtoexameilitiminrmdifferentstamnttrmeratetorxaxampsatishaimellmplandstrunderstandingtutorssrirenthsthatfepleplndo


More Tutorials from this section

Ask Questions?    Discuss: Mysql Date and Time  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

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.