I've set up a form where a user can input a date + time + timezone.

After submitting the form, in my controller, $this->request->data contains 
this:
[ 
    'date' => [
        'year' => '2015', 
        'month' => '02', 
        'day' => '12', 
        'hour' => '22', 
        'minute' => '54', 
        'timezone' => 'Europe/Paris'
    ]
]



After creating an entity using $table->newEntity($this->request->data), 
$entity->date contains:

object(Cake\I18n\Time) { 
    'time' => '2015-02-12T*22*:54:00+0000', 
    'timezone' => '*UTC*', 
    'fixedNowTime' => false 
} 



Although I was expecting it to contain:

object(Cake\I18n\Time) { 
    'time' => '2015-02-12T*22*:54:00+0000', 
    'timezone' => '*Europe/Paris*', 
    'fixedNowTime' => false 
} 

OR

object(Cake\I18n\Time) { 
    'time' => '2015-02-12T*21*:54:00+0000', 
    'timezone' => '*UTC*', 
    'fixedNowTime' => false 
} 


Is this the expected behavior? If yes how can I (easily) correctly 
instantiate the date in my entity by taking into account the timezone 
submitted by the user?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to