SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2005
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Converting TIMESTAMP to DATETIME

    Hi all,

    I am converting an existing database for use with a new script, problem is the new script uses the DATETIME format while the old database stores the time in TIMESTAMP format. Is there a way to convert the field data from TIMESTAMP into DATETIME with a MySQL query?

    Thanks a lot, your help is greatly appreciated.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,250
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    back up your table and then run this --
    Code:
    ALTER TABLE test5
    CHANGE COLUMN foo foo DATETIME
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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