Welcome Guest, Not a member yet? Register   Sign In
PHP Date/Time Configuration (php.ini) [SOLVED]
#1

[eluser]rochellecanale[/eluser]
Hello guys actually this is not a CI problem. But since that I've been using this framework for a year and there's a lot of professional programmer here. I hope you can help me. My problem is simple. I just want to configure my PHP date/time in php.ini. I'm from Philippines so i have a value like this.

Code:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Manila

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

But when i examined my date and time function. It is not giving me the correct time. Let's say today is November 20, 2012 my code will display November 21, 2012. So it skips the day today. How can I solve this? do I need to configure the date.default_latitude and date.default_longitude? I tried adding double quotes around the date.timezone value. But nothing happened. That's all guys hope you can help me.
#2

[eluser]Aken[/eluser]
Did you restart your server? Changes to php.ini usually need a reboot in order to take effect.
#3

[eluser]Unknown[/eluser]
I'm also from Philippines.;-)
try this one
class My_class extends Controller
{
function __construct()
{
parent::Controller();
$timezone = "Asia/Manila";
putenv ('TZ=' . $timezone);
}
}

#4

[eluser]rochellecanale[/eluser]
Thanks. I found the answer i just need to update my computer timezone and disable windows time.




Theme © iAndrew 2016 - Forum software by © MyBB