date("r") shows a different timing!! :(
Posted: Fri Nov 24, 2006 3:15 am
it shows Fri, 24 Nov 2006 09:13:08 +0000
when the current time is 5.15pm
anyone?
when the current time is 5.15pm
anyone?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
That's the time on the server. The server must be based in the UK. Where are you?lmh85 wrote:it shows Fri, 24 Nov 2006 09:13:08 +0000
when the current time is 5.15pm
anyone?
Code: Select all
putenv("TZ=Etc/GMT+8");Code: Select all
date('r', time()+(8*60));Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
function fnc_date_calc($this_date,$num_days,$display){
$my_time = strtotime ($this_date); //converts date string to UNIX timestamp
$timestamp = $my_time + ($num_days * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400)
if($display==1){
$return_date = date("d-m-Y",$timestamp); //puts the UNIX timestamp back into string format
}else{
$return_date = date("Y-m-d",$timestamp); //puts the UNIX timestamp back into string format
}
return $return_date;//exit function and return string
}//end of functionCode: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]