The purpose of the post_date_gmt?

Some countries use a Daylight Saving Time (DST): Typically clocks are adjusted forward one hour near the start of spring and are adjusted backward in autumn. Sometimes there is no 2 am. Sometimes you get 2 am two times. To avoid cron jobs running twice or not at all WP needs the GMT (or more … Read more

How to get date for each post?

I ran into the same problem several times, following changes worked for me in the past: while (have_posts()) : the_post(); //some html <li class=”icon-date”><?php echo get_the_date( ‘Y-m-d’ ); ?></li> <li class=”icon-time”><?php the_time( ‘H:i:s’ ); ?></li> Instead of the_date(), use get_the_date(). The only thing to be aware of, is that values returned by get_the_date() have to … Read more

Convert number to month name in PHP

The recommended way to do this: Nowadays, you should really be using DateTime objects for any date/time math. This requires you to have a PHP version >= 5.2. As shown in Glavić’s answer, you can use the following: The ! formatting character is used to reset everything to the Unix epoch. The m format character is the numeric representation of a month, … Read more