Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php on line 6121
How to convert text column to datetime in SQL?

Home Forums MYSQL How to convert text column to datetime in SQL?

Viewing 0 reply threads
  • Author
    Posts
    • #115
      avi
      Participant

      Step 1: Add new Column
      ALTER TABLE table_name ADD (duplicate_column datetime);
      Step 2: Update new Column with existing value
      UPDATE table_name SET duplicate_column = str_to_date(column_name, '%d-%m-%Y %h:%i:%s');

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Scroll to Top