Hi
Can anyone enlighten me as to why the following code:
$date = "31-12-2009";
for ($i = 1; $i <= 365; $i++) {
$newdate = strtotime ( '+1 day' , strtotime ( $date ) ) ;
$newdate = date ( 'd-m-Y' , $newdate );
$timestamp = strtotime($newdate);
echo "(",$i, ", '",$newdate,"', ",$timestamp,")<br>";
$date = $newdate ;
}
Outputs:
(1, '01-01-2010', 1262300400)
(2, '02-01-2010', 1262386800)
(3, '03-01-2010', 1262473200)
(4, '04-01-2010', 1262559600)
(5, '05-01-2010', 1262646000)......
On my local server [windows + XAMPP php ver 5.28]
but on my webhosts server it outputs:
(1, '01-06-2037', 1167260400)
(2, '29-12-2006', 2064002400)
(3, '30-05-2035', 2079558000)
(4, '26-11-2035', 1969221600)
(5, '28-05-2032', 2016226800).......
[php ver4.49]
I'm trying to populate a MYSQL database with:
[ID] -- [date] -- [timestamp]
'1' '01-06-2037' '1167260400'
So I can calculate dates
I have my site working perfectly locally but when I uploaded it nothing would work.