christo87
asked on
PHP date function - removing time
Hi,
I'm using the date function to return the date into a news page I'm making (nothing big, just some feeds I like that I'm still working on - http://chris.clook.net/news/syn.php ), and the time on the server is five hours ahead of my local time. Here's the code I've used for the time http://chris.clook.net/news/syn.php.txt - what can I use to take five hours off? I tried many things with the letter Z (from the PHP manual) subtracting 18000 seconds (five hours), but I haven't gotten anything to work. Does anybody know what I'm doing wrong?
Thanks, Chris
I'm using the date function to return the date into a news page I'm making (nothing big, just some feeds I like that I'm still working on - http://chris.clook.net/news/syn.php ), and the time on the server is five hours ahead of my local time. Here's the code I've used for the time http://chris.clook.net/news/syn.php.txt - what can I use to take five hours off? I tried many things with the letter Z (from the PHP manual) subtracting 18000 seconds (five hours), but I haven't gotten anything to work. Does anybody know what I'm doing wrong?
Thanks, Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
date("M-d-Y H:i:s", mktime(date("G")-5, date("i"), date("s"), date("m"), date("d"), date("Y")));
The mktime function do exactly what you need whenever you want to change time and date.