date("r") shows a different timing!! :(
Moderator: General Moderators
date("r") shows a different timing!! :(
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?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: date("r") shows a different timing!! :(
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?
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Try out date_default_timezone_set
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Did you use the correct timezone with date_default_timezone_set
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Try
Code: Select all
putenv("TZ=Etc/GMT+8");- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
You could always alter your timestamp, but you would have to do it every time you called date:
Code: Select all
date('r', time()+(8*60));feyd | Please use
i'm having this function.. which adds num days if i call it. It do work fine in my developing machine.. But not my web server.. Is there any one whom can help?
feyd | Please use
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 functionfeyd | Please use
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]