Jump to content

Date/Time Help


Recommended Posts

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.


$mydate=fread($fr, 50);
if ($incremental_updates == 1){
$contest=str_replace("{DATE_TAG}", $mydate, $contest);
fwrite($f, $contest);
fwrite($fw, substr(date('c'), 0, 19));
$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.






Link to comment
Share on other sites

I realize I may have made that more complex than it needs to be.


Here it is in simpler terms.


If I do this;

echo substr(date('c'), 0, 19);


I can get back this;



I want it to return this;



Which simply adds two hours.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.