Ok so Thanks for your help. FInally I try this :

 date_default_timezone_set('GMT');

// create a date object
echo 'Mysql Datetime (GMT insert) : ';
echo $mysql_datetime_gmt= '2007-10-03 19:10';

// false parameter because it's Mysql Datetime format...
$date = new Zend_Date($mysql_datetime_gmt, false, 'fr');

// view our date object
echo '<br />Zend_Date::getIso : '.$date->getIso();
// what timezone do we have ?
echo '<br />Zend_Date::getTimezone : '. $date->getTimezone();

echo '<br /><br />Change Timezone to Europe/Paris';
// set another timezone
$date->setTimezone('Europe/Paris');

// what timezone do we now have ?
echo '<br />Zend_Date::getTimezone : '. $date->getTimezone();
// see the changed date object
echo '<br />Zend_Date::getIso : '.$date->getIso();


And I get :
Mysql Datetime (GMT insert) : 2007-10-03 19:10
Zend_Date::getIso : 2007-10-03T19:10:00+00:00
Zend_Date::getTimezone : GMT

Change Timezone to Europe/Paris
Zend_Date::getTimezone : Europe/Paris
Zend_Date::getIso : 2007-10-03T21:10:00+02:00

So good :)



On 10/4/07, Yann Nave <[EMAIL PROTECTED]> wrote:
> But YYYY-MM-dd hh:mm  isnt' ISO format :s Just Mysql Datetime... :s
> On 10/4/07, Wolfgang Forstmeier <[EMAIL PROTECTED]> wrote:
> > Hey Yann,
> >
> > you should have a look to the manual,
> > there is something you are looking for.
> >
> > http://framework.zend.com/manual/en/zend.date.additional.html#zend.date.additional.timezones
> >
> > On 10/4/07, Yann Nave <[EMAIL PROTECTED]> wrote:
> > > Hye,
> > >
> > > It' a little mess for me yo understand how to convert date betwenn GMT
> > > and Europe/Paris for example.
> > >
> > > Field form my DB is like :  2007-08-03 19:54   ( GMT )
> > > I would like to convert  it in user's Timezone (like Europe/Paris).
> > >
> > > How can I do it ?
> > >
> > > --
> > > Yannux
> > > http://blog.onbebop.net
> > >
> >
> >
> > --
> > Mit freundlichen Grüßen
> > With best regards
> >
> > Wolfgang Forstmeier
> > -------------------------------------------
> > +49° 34' 26.76", +11° 0' 48.60"
> > -------------------------------------------
> > mailto:[EMAIL PROTECTED]
> >
>
>
> --
> Yannux
> http://blog.onbebop.net
>


-- 
Yannux
http://blog.onbebop.net

Reply via email to