Support » Networking WordPress » wp_blogs table registered, last_updated columns and timezones

  • Hi,

    firstly I want to aks, why the registered and last_updated columns in the wp_blogs table are in gmt+0?
    It is a bug or it is correct like this?

    I searched through the core code and I found these:

    wp-includes/ms-functions.php
    $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'blog_id' => 1, 'domain' => $domain, 'path' => $path, <strong>'registered' => current_time( 'mysql' )</strong> ) );
    
    wp-admin/includes/schema.php
    $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'blog_id' => 1, 'domain' => $domain, 'path' => $path, <strong>'registered' => current_time( 'mysql' )</strong> ) );
    
    wp-admin/includes/upgrade.php
    $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, <strong>'last_updated' => current_time('mysql', true)</strong>) );
    
    wp-includes/ms-blog.php
    $result = $wpdb->update( $wpdb->blogs, array($pref => $value, <strong>'last_updated' => current_time('mysql', true)</strong>), array('blog_id' => $blog_id) );

    So the registered date is gmt+x (if you set the timezone), but the last_updated date in the wp_blogs table is always gmt+0.
    Now in my blog it causes, that when a blog is freshly registered, then the last_updated date is earlier than the registered date.

    Not good, that these two dates can be in different timezones.

    Anybody can answer it?
    Thanks!

  • The topic ‘wp_blogs table registered, last_updated columns and timezones’ is closed to new replies.