Changeset 911
- Timestamp:
- 02/23/2004 01:52:38 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/upgrade-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r904 r911 713 713 } 714 714 715 /* for GMT dates: this is commented until all of WP can deal with GMT 716 $time_difference = get_settings('time_difference'); 717 718 $server_time = gmmktime(date('H'), date('i'), date('s'), date('m'), date('d'), date('Y')); 719 $w = date('Y-m-d H:i:s', time() + $time_difference*3600); 720 $weblogger_time = gmmktime(substr($w,11,13), substr($w,14,16), substr($w,17,19), substr($w,5,7), substr($w,8,10), substr($w,0,4)); 721 $gmt_time = time(); 722 723 $diff_gmt_server = ($gmt_time - $server_time) / 3600; 724 $diff_weblogger_server = ($weblogger_time - $server_time) / 3600; 725 $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server; 726 727 if (strval(current_time('timestamp') - $time_difference*3600) != gmdate('Y-m-d H:i:s', time())) { 728 729 $new_time_difference = -$diff_gmt_weblogger; 730 731 $add_hours = intval($diff_gmt_weblogger); 732 $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); 733 734 #field names to update: 735 #wp_posts.post_date 736 #wp_posts.post_modified 737 #wp_comments.comment_date 738 #wp_users.dateYMDhour 739 740 #the queries are simple 741 $wpdb->query("UPDATE $tableposts SET post_date = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); 742 $wpdb->query("UPDATE $tableposts SET post_modified = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'"); 743 $wpdb->query("UPDATE $tablecomments SET comment_date = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE"); 744 $wpdb->query("UPDATE $tableusers SET dateYMDhour = DATE_ADD(dateYMDhour, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); 745 746 #and then we update time_difference to use the new value 747 $wpdb->query("UPDATE $tableoptions SET option_value = '$new_time_difference' WHERE option_name = 'time_difference'"); 748 749 } else { 750 751 #if the times are already stored as GMT, we shouldn't have anything to do 752 #except set time_difference to zero 753 $wpdb->query("UPDATE $tableoptions SET option_value = '0' WHERE option_name = 'time_difference'"); 754 755 } 756 */ 757 715 758 } 716 759
Note: See TracChangeset
for help on using the changeset viewer.