1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

PHP Programming Help

Discussion in 'BBS Hangout' started by jmejia, Feb 27, 2009.

  1. jmejia

    jmejia Member

    Joined:
    Jul 18, 2005
    Messages:
    399
    Likes Received:
    2
    I'm almost done with a website and I have an email form that I am using PHP to send emails. The server that I have the site on is on GMT time. I want the output time of that php script to give me the CST which is -0600. Below is my date() function.

    $todayis = date("l, F j, Y, g:i a \[T\]") ;

    This is really frustrating me that I can't find the answer but maybe someone here can help.

    Does anyone know a work around to this issue. I don't want to have to convert between time zones every time we get comments from the site.

    Thanks a bunch.

    The site and form if you guys are interested is http://kidsdepotlearning.com and go to the contacts tab.
     
  2. Kyakko

    Kyakko Member

    Joined:
    Aug 15, 2002
    Messages:
    2,161
    Likes Received:
    39
    try using the timestamp feature minus -600 minutes. i.e. pseudo code:

    date("...", time()-600) ;

    time() is acurate up to the millisec so it's not -600 but i don't want to do the math. this is just the top of my head.. see if it works.
     
  3. Jugdish

    Jugdish Member

    Joined:
    Mar 27, 2006
    Messages:
    9,093
    Likes Received:
    9,611
    00101011001010000010100111101001000101011100100100010001001000010101000101001000001001010010111001000100101

    You're welcome.
     
  4. Kyakko

    Kyakko Member

    Joined:
    Aug 15, 2002
    Messages:
    2,161
    Likes Received:
    39
    actually i'm wrong.. time() is accurate up to the second. try this:

    $todayis = date("l, F j, Y, g:i a \[T\]", time() - (6 * 60 * 60)) ;
     

Share This Page