Results 1 to 3 of 3

Thread: Zend_Date and Europe/London timezone conversion

  1. #1
    lvgunst is offline Junior Member
    Join Date
    Feb 2010
    Posts
    2

    Default Zend_Date and Europe/London timezone conversion

    I am trying to convert a time from timezone Europe/London (GMT) to Europe/Amsterdam (GMT+01:00).

    Code:
    // Wrong
    date_default_timezone_set('Europe/London');
    $date = new Zend_Date('11-02-10 10:00', Zend_Date::DATETIME_SHORT, 'nl'); // 11 feb 2010 10:00
    echo $date->get(Zend_Date::ISO_8601) . '<br/>'; // 2010-02-10T09:00:00+00:00
    		
    $date->setTimezone('Europe/Amsterdam');
    echo $date->get(Zend_Date::ISO_8601) . '<br/>'; // 2010-02-10T10:00:00+01:00
    
    // Expected
    date_default_timezone_set('GMT');
    $date = new Zend_Date('11-02-10 10:00', Zend_Date::DATETIME_SHORT, 'nl'); // 11 feb 2010 10:00
    echo $date->get(Zend_Date::ISO_8601) . '<br/>'; // 2010-02-11T10:00:00+00:00
    		
    $date->setTimezone('Europe/Amsterdam');
    echo $date->get(Zend_Date::ISO_8601) . '<br/>'; // 2010-02-11T11:00:00+01:00
    - When I use Europe/London as input timezone it converts the time (-1 hour)
    - When I use GMT as input timezone the conversion is ok

    Why is there a time conversion when I use Europe/London. Europe/London == GMT right?

    Does anyone know what I am doing wrong?

  2. #2
    thomas is offline Senior Member
    Join Date
    Aug 2008
    Posts
    174

    Default

    GMT !== Europe/London

    GMT = No DST
    Europe/London = With DST
    Greetings
    Thomas Weidner
    I18N Team Leader, Zend Framework
    http://www.thomasweidner.com

  3. #3
    lvgunst is offline Junior Member
    Join Date
    Feb 2010
    Posts
    2

    Default

    O oke I see. But why is it, when I input 11-02-10 10:00 it automatically substracts 1 hour when I use Europe/London as input?

    I just want to convert 10 am London time to Amsterdam time (say +1 hour).

    I expect 2010-02-11T11:00:00+01:00 Amsterdam time.

Similar Threads

  1. PHP Architect : £50,000 - £80,000 : London, UK (Full Time, Permanent Opportunity)
    By IT_ Recruiter in forum Paid work offers and requests
    Replies: 0
    Last Post: 06-29-2010, 11:53 AM
  2. Freelance and Perm PHP Developers London
    By nakamalondon in forum Paid work offers and requests
    Replies: 0
    Last Post: 06-09-2010, 02:20 PM
  3. Permanent PHP Developer, London, Soho
    By timruffles in forum Paid work offers and requests
    Replies: 0
    Last Post: 01-26-2010, 10:51 AM
  4. [Help] A Simple php code conversion to use ZF
    By Testando in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 09-25-2009, 06:36 PM
  5. Zend_Date's getTimestamp() vs. get(Zend_Date::TIMESTAMP)
    By robinlindroos in forum Internationalization (i18n) & Localization (l10n)
    Replies: 2
    Last Post: 09-02-2009, 06:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •