Why wordpress using two column to store post date


#1

I see wordpress database on wp_posts table, there are 2 columns to store post date, post_date and post_date_gmt

post_date_gmt store the post date in GMT time. And post_date store post date in user time who create the post. Am I right?

Is there any benefit to store both version of post date on database?

Is it faster to store both version of post date rather than calculate post_date_gmt with user timezone when user want to view post date based on his/her timezone


#2

The one benefit it would provide is that if the person moves to a different timezone then their earlier posts still record what time it was where they were when they posted them and not what time it was where they are now (as would be all you could calculate using the GMT time and their current timezone).


#3

Impact on performance is so minimal that it shouldn't even be considered.
Yes, it would be faster if you removed one of the columns since there would be 1 operation less to do with each entry, but really - it's not an area where anyone should consider for optimizing since it's not the bottleneck.


#4

thanks for the response, I just curious if there any special case on wordpress so they use 2 column to store post date. maybe there are really no effect on performance