<?
//database parameters
$dbHost = "localhost";
$dbUser = "username";
$dbPass = "password";
$dbName = "database";
//start and end ID of the posts to modify
$startPost = 100;
$endPost = 200;
//time the first post
$postHr = 12;
$postMin = 34;
$postSec = 56;
//date of the first post
$startMonth = 5;
$startDay = 1;
$startYear = 2008;
//amount to increment between posts
$dateIncrement = "+1 day";
$postDate = mktime($postHr,$postMin,$postSec,$startMonth,$startDay,$startYear);
$postDate_gmt = gmmktime($postHr,$postMin,$postSec,$startMonth,$startDay,$startYear);
mysql_connect($dbHost,$dbUser,$dbPass);
mysql_select_db($dbName);
foreach(range($startPost,$endPost) as $post)
{
$sql = sprintf(strftime(strftime("UPDATE wp_posts SET post_date = '%Y-%m-%d %H:%M:%S', post_date_gmt = '%%Y-%%m-%%d %%H:%%M:%%S' WHERE ID = %%%%s",$postDate),$postDate_gmt),$post);
mysql_query($sql);
$postDate->modify($dateIncrement);
$postDate_gmt->modify($dateIncrement);
}
?>