Difference between date and date_gmt

In my database comment_date and comment_date_gmt are different. comment_date is in UTC+3, but comment_date_gmt in UTC+0.

Why? What do I not right? When I leave the comment I can see "You left a comment 3 hours ago"

Topic timezones comments Wordpress

Category Web


The database is correct in this case. comment_date is the datetime of your WordPress timezone setting and comment_date_gmt is the same datetime, but converted to Greenwich Mean Time (GMT). GMT is the timezone all other timezones are offset from while UTC is the time standard. In most practical applications they're interchangeable.

The problem you're probably having is either saving or reading the datetime converted to your local timezone from either GMT or your site's set timezone.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.