Skip to content

Instantly share code, notes, and snippets.

// mysql queries
INSERT INTO `tests` (`stamp`) VALUES ('2015-07-01T00:00:00+0000');
INSERT INTO `tests` (`stamp`) VALUES ('2015-07-01 00:00:00');
INSERT INTO `tests` (`stamp`) VALUES ('2015-07-01T00:00:00+0400');
INSERT INTO `tests` (`stamp`) VALUES ('2015-07-01 00:00:00');
@Schlaefer
Schlaefer / php.php
Created July 16, 2015 19:54
cakephp 3 marshaller timezone ignore workaround
<?php
$entity = $table->newEntity(
[
'evaluationDate' => (new Time('2015-07-01T00:00:00+0200'))->timezone('UTC')
]
);
$table->save($entity);
class Plugin extends \Phile\Plugin\AbstractPlugin
{
protected $events = ['request_uri' => 'startup'];
public function startup($data)
{
if ($data['uri'] === 'foo') {
// matches URL
$this->doStuffOnFoo();
exit();