How to Setting default time zone in apache webserver for php | Konsultan IT dan jaringan Area Flores

How to Setting default time zone in apache webserver for php

Written on 18 February, 2009 – 8:03 pm | by dedyisn | 5,819 views

Sometimes when you using php script, it doesn’t show the correct time. We can easily resolved this problem by setting some string in php.ini script. In Linux, if you installing apache2 and php5 manually, browse to directory /etc/php5/apache2/. you can find php.ini on it. just do some command :

nano /etc/php5/apache2/php.ini

Find string :

;date.timezone =

Edit it to your timezone ( Example in my PC )

date.timezone = “Asia/Makassar”

For your city, just browse to timezone

Share and Enjoy:
  • del.icio.us
  • Technorati
  • Digg
  • Facebook
  • Google Bookmarks
  • MySpace
  • YahooMyWeb

Related Posts

  1. 3 Responses to “How to Setting default time zone in apache webserver for php”

  2. ageNo Gravatar on May 12, 2009

    I tried, no luck. after i change the timezone in pnp.ini to “Asia/Jakarta” and have a page contains echo(date_default_timezone_get());
    it still shows: Asia/Krasnoyarsk

    .. any clue.. BTW its 1 hour differece with my LOCAL time

    thxComment posted using Mozilla Firefox Mozilla Firefox 3.0.10 on Windows Windows XP

    Reply

    dedyisnNo Gravatar (77 comments.) on May 13, 2009

    what OS that u use ? windows ? I’m not sure where php.ini is stored in windows cause it depends on your server that u use . sometimes php.ini store in C://Windows/ or in Apache folder. But make sure if you have change, restart your apache webserver .
    For example in my PC, i’m using appserv ( it’s included apache2,php5,mysql and phpmyadmin) . I just edit php.ini in C:/appserv/apache/php.iniComment posted using Mozilla Firefox Mozilla Firefox 3.5b4 on Windows Windows XP

    Reply

  3. EndrikNo Gravatar on Aug 13, 2009

    Try to put below code before you execute some date function:

    putenv(”TZ=Asia/Jakarta”);Comment posted using Mozilla Firefox Mozilla Firefox 3.0.12 on Windows Windows XP

    Reply

Post a Comment

:hihi: :hiks: :melet: :nangis: :ngakak: :puyeng: :sip: more »

CommentLuv Enabled

About Me

Here I'll share my knowledge, discovery and experience related to my hobby and work. Most articles on this site are related to tips , my practice result and offcourse about me too. If you want a review for your website or product, contact me via YM or email. For Consultant service in flores "Maumere, Larantuka, Ende, Ruteng, and Bajawa ", just contact me @ email : dedyisn@gmail.com More

Want to subscribe?

 Subscribe in a reader Or, subscribe via email:

Please Enter your email address:

I'm Member of :
Custom Search