doubt in time() function...

Discussion in 'PHP' started by narengr, Jul 16, 2007.

  1. #1
    Hello all...

    Please help me out....

    I am Narendran, student. I wanted to add the present time to my interface created using PHP.
    "
    echo(date("h:i:s A") . "<br />");
    echo(date("l\, dS \of F Y ") . "<br />");
    "
    This is my coding.
    But this represents the GMT(Greenwich Meridian Time). I am from India, so i require my time to be 5 hours and 30 mins ahead of GMT. Please help me in acheiving this time...

    Thanks in advance.....
    Regards

    Naren
     
    narengr, Jul 16, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    echo(date("h:i:s A", strtotime('+5 Hours 30 Minutes')) . "<br />");
    
    PHP:
    Untested but should work.

    Or you may as well have a look at date_default_timezone_set().
     
    nico_swd, Jul 16, 2007 IP
  3. narengr

    narengr Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks nico_swd .... It works well.....
     
    narengr, Jul 16, 2007 IP