Databases| SQL| MySQL| Questions? | Software Development
 

Mysql Date Format Convert

                         

You already Know with the Query to find the current date and time. Now, we help you to convert the Mysql Date Format Conversion into other time zone.

Understand with Example

The Tutorial illustrate an example 'Mysql Date Format Convert'. To grasp this concept we use Date now ( ) Query that return you the current today date and time.

now ( ) : The Query now ( ) return you the current date and time

Query for finding current date and time:-

mysql> select now()as date;

Output:-

+---------------------+
| date                |
+---------------------+
| 2008-12-22 10:05:20 |
+---------------------+
1 row in set (0.00 sec)

Query for converting current date and time to other timezone:-

Once you find out with the current date, we can convert the current date and time into other timezone. The below Syntax Query convert the current date and time to other timezone.   

SYNTAX:-CONVERT_TZ(date,from_tz,to_tz)

mysql> select convert_tz('2008-12-22 10:07:00','+05:30','-06:00')as ConvertedDate;

Output:-

+---------------------+
| ConvertedDate       |
+---------------------+
| 2008-12-21 22:37:00 |
+---------------------+
1 row in set (0.00 sec)

                         

» View all related tutorials
Related Tags: sql mysql c search table date data ui sed type word tutorial key field name ria this id create tab

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.