Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2009, 03:56 AM   PM User | #1
eschuppe
New Coder

 
Join Date: Mar 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
eschuppe is an unknown quantity at this point
Changing datetime

I'm trying to use the relaxed punctuation for datetime but I can't figure out how to make it work.
the current format I have is:
0000-00-00 00:00:00

And I would like
MM/DD/YYYY HH:MM

Can someone please tell me how I could do this?

Thank you!
eschuppe is offline   Reply With Quote
Old 03-18-2009, 07:52 AM   PM User | #2
bdl
Regular Coder

 
Join Date: Apr 2007
Location: Camarillo, CA US
Posts: 590
Thanks: 4
Thanked 83 Times in 82 Posts
bdl is an unknown quantity at this point
If this is a server you have some control over, you can configure it to alter the DATETIME syntax with the date_format or datetime_format variables.

What I would suggest, however, is leaving the data format as-is and retrieving it using the DATE_FORMAT() function, so you can display the date in any manner you wish.
bdl is offline   Reply With Quote
Old 03-18-2009, 01:53 PM   PM User | #3
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
Quote:
Originally Posted by bdl View Post
If this is a server you have some control over, you can configure it to alter the DATETIME syntax with the date_format or datetime_format variables.
Think I saw a post on this yesterday and those variables can only be set in mysql 6.0.x

I'd use DATE_FORMAT (as you suggested later in your post) myself.
guelphdad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:14 AM.


Advertisement
Log in to turn off these ads.