Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    25
    Thanks
    3
    Thanked 0 Times in 0 Posts

    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!

  • #2
    bdl
    bdl is offline
    Regular Coder
    Join Date
    Apr 2007
    Location
    Camarillo, CA US
    Posts
    590
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •