How to change database timezone from UTC to local in wordpress

I’m using a custom plugin in wordpress. All date and time are stored in database as UTC. I saw in posts table, there’re 2 columns for UTC and local timezone (post_date, post_date_gtm), but in this plugin table, there’s only 1 column to store the created date as UTC.

Currently, I’m using sql query and $wpdb to show the data between “start date” and “end date”.
Please help me to show them in local timezone (That is setted in general setting) instead of UTC!

Read More

Thanks and sorry about my English.

Related posts

3 comments

  1. Assume your local time zone is +05:00, use the following condition:

    WHERE CONVERT_TZ(col_date_utc, '+00:00', '+05:00') BETWEEN '....' AND '....'
    
  2. I thought this might be useful

    There are 3 places where the timezone might be set in MySQL:
    Check here link

Comments are closed.