I have a batch script that reads from a timestamp.txt file to determine the last time it ran and I need to modify that by two hours.
What happens is the script will run to look for changes in the county records and their server time is two hours different from mine.
$fr=fopen("xml/timestamp.txt",'r');
$mydate=fread($fr, 50);
if ($incremental_updates == 1){
$default_template_file="xml/incremental_template.xml";
$default_config_name="xml/incremental.xml";
$contest=file_get_contents($default_template_file);
$contest=str_replace("{DATE_TAG}", $mydate, $contest);
$f=fopen($default_config_name,'w+');
fwrite($f, $contest);
fclose($f);
fclose($fr);
$fw=fopen("xml/timestamp.txt",'w');
fwrite($fw, substr(date('c'), 0, 19));
fclose($fw);
}else{
$default_config_name = "xml/full_update.xml";
}
I tried making a time stamp update look like $cur_timestamp=date("Y-m-d H:i:s", time() +14400); which is correct but it doesn't write to the text file properly.
Using the above fwrite($fw, substr(date('c'), 0, 19));
I get the correct results in the timestamp.txt file for my server time. I need it to be +14400
2011-05-25T08:27:51 would essentially become 2011-05-25T10:27:51 when it writes to the timestamp.txt
I hope that makes sense.
J