set timezone with php4

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mun

    #1

    set timezone with php4

    My server is in the US and I want to set a different timezone (GMT
    +7), so that I can have an appropriate time for my country. How to do
    this in php4?

  • Satya

    #2
    Re: set timezone with php4

    On Mar 21, 5:52 am, "mun" <vong...@gmail. comwrote:
    My server is in the US and I want to set a different timezone (GMT
    +7), so that I can have an appropriate time for my country. How to do
    this in php4?
    Use gmdate() at time of storing date in DB. and add your required
    time(+7 hr) at the time of using that or

    putenv("TZ=Asia/Calcutta");
    echo "New Time: ". date("h:i:s")." \n";

    Complete time zone listing is here:


    Happy Programming.

    Comment

    • mun

      #3
      Re: set timezone with php4

      On Mar 26, 1:09 pm, "Satya" <satya61...@gma il.comwrote:
      On Mar 21, 5:52 am, "mun" <vong...@gmail. comwrote:
      >
      My server is in the US and I want to set a different timezone (GMT
      +7), so that I can have an appropriate time for my country. How to do
      this in php4?
      >
      Use gmdate() at time of storing date in DB. and add your required
      time(+7 hr) at the time of using that or
      >
      putenv("TZ=Asia/Calcutta");
      echo "New Time: ". date("h:i:s")." \n";
      >
      Complete time zone listing is here:http://www.theprojects.org/dev/zone.txt
      >
      Happy Programming.
      thank you. but I dont understand the phrase "add your required
      time(+7 hr) at the time of using that".

      Comment

      Working...