1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Full Date and Time of a given localization

Discussion in 'PHP' started by Germaris, Jul 17, 2007.

  1. #1
    Hi there !

    I wish to display in my Flash File (don't worry about Flash, I know how to handle PHP results and send them to Flash !) which is read all throughout the world, the Full Date and Time of my Home.

    My Server is in California, I am living in Quebec (three hours of difference) and my File could be read by friends in Japan or Indi or South Africa.
    Displaying the Date and Time of my Home will say to my friends, for example : "Don't phone me, I'm sleeping" !!! He he he...

    I thank you very much in advance for any advice, link, or active help !!!
     
    Germaris, Jul 17, 2007 IP
  2. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    $timezone=-1234; // Quebec timezone in seconds - should be negative
    $dateStr=gmdate('Y-m-d H:m:s',time()+$timezone);
    echo $dateStr;
    PHP:
     
    Weizheng, Jul 17, 2007 IP
  3. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #3
    or just do the offset. cst i think is +5 hours so
    
    echo date("F d, Y g:i a",strtotime("+5 hours"));
    
    PHP:
     
    ansi, Jul 17, 2007 IP