我正在将实体中的数据序列化为json文件。我稍后将使用此json文件加载数据表:
$table = $this->getDoctrine()->getRepository($EntityName)->findAll();
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
$data = $serializer->serialize($table, 'json');
运行良好。但是现在我在实体中添加了一个datetime字段:
/**
* @ORM\Column(type="datetime")
*/
private $timestamp;
现在我的json文件变得越来越大:
[{"id":1,"uniqueId":"5235523423","timestamp":{"timezone":{"name":"Europe\/Berlin","transitions":[{"ts":-9223372036854775808,"time":"-292277022657-01-27T08:29:52+0000","offset":3208,"isdst":false,"abbr":"LMT"},{"ts":-2147483648,"time":"1901-12-13T20:45:52+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1693706400,"time":"1916-04-30T22:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1680483600,"time":"1916-09-30T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1663455600,"time":"1917-04-16T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1650150000,"time":"1917-09-17T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1632006000,"time":"1918-04-15T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1618700400,"time":"1918-09-16T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-938905200,"time":"1940-04-01T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-857257200,"time":"1942-11-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-844556400,"time":"1943-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-828226800,"time":"1943-10-04T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-812502000,"time":"1944-04-03T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-796777200,"time":"1944-10-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-781052400,"time":"1945-04-02T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-776563200,"time":"1945-05-24T00:00:00+0000","offset":10800,"isdst":true,"abbr":"CEMT"},{"ts":-765936000,"time":"1945-09-24T00:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-761180400,"time":"1945-11-18T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-757386000,"time":"1945-12-31T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-748479600,"time":"1946-04-14T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-733273200,"time":"1946-10-07T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-717631200,"time":"1947-04-06T02:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-714610800,"time":"1947-05-11T01:00:00+0000","offset":10800,"isdst":true,"abbr":"CEMT"},{"ts":-710380800,"time":"1947-06-29T00:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-701910000,"time":"1947-10-05T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-684975600,"time":"1948-04-18T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-670460400,"time":"1948-10-03T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-654130800,"time":"1949-04-10T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-639010800,"time":"1949-10-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":315529200,"time":"1979-12-31T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":323830800,"time":"1980-04-06T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":338950800,"time":"1980-09-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":354675600,"time":"1981-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":370400400,"time":"1981-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":386125200,"time":"1982-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":401850000,"time":"1982-09-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":417574800,"time":"1983-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":433299600,"time":"1983-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":449024400,"time":"1984-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":465354000,"time":"1984-09-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":481078800,"time":"1985-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":496803600,"time":"1985-09-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":512528400,"time":"1986-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":528253200,"time":"1986-09-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":543978000,"time":"1987-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":559702800,"time":"1987-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":575427600,"time":"1988-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":591152400,"time":"1988-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":606877200,"time":"1989-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":622602000,"time":"1989-09-24T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":638326800,"time":"1990-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":654656400,"time":"1990-09-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":670381200,"time":"1991-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":686106000,"time":"1991-09-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":701830800,"time":"1992-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":717555600,"time":"1992-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":733280400,"time":"1993-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":749005200,"time":"1993-09-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":764730000,"time":"1994-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":780454800,"time":"1994-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":796179600,"time":"1995-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":811904400,"time":"1995-09-24T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":828234000,"time":"1996-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":846378000,"time":"1996-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":859683600,"time":"1997-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":877827600,"time":"1997-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":891133200,"time":"1998-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":909277200,"time":"1998-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":922582800,"time":"1999-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":941331600,"time":"1999-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":954032400,"time":"2000-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":972781200,"time":"2000-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":985482000,"time":"2001-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1004230800,"time":"2001-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1017536400,"time":"2002-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1035680400,"time":"2002-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1048986000,"time":"2003-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1067130000,"time":"2003-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1080435600,"time":"2004-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1099184400,"time":"2004-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1111885200,"time":"2005-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1130634000,"time":"2005-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1143334800,"time":"2006-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1162083600,"time":"2006-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1174784400,"time":"2007-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1193533200,"time":"2007-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1206838800,"time":"2008-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1224982800,"time":"2008-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1238288400,"time":"2009-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1256432400,"time":"2009-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1269738000,"time":"2010-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1288486800,"time":"2010-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1301187600,"time":"2011-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1319936400,"time":"2011-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1332637200,"time":"2012-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1351386000,"time":"2012-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1364691600,"time":"2013-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1382835600,"time":"2013-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1396141200,"time":"2014-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1414285200,"time":"2014-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1427590800,"time":"2015-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1445734800,"time":"2015-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1459040400,"time":"2016-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1477789200,"time":"2016-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1490490000,"time":"2017-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1509238800,"time":"2017-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1521939600,"time":"2018-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1540688400,"time":"2018-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1553994000,"time":"2019-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1572138000,"time":"2019-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1585443600,"time":"2020-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1603587600,"time":"2020-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1616893200,"time":"2021-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1635642000,"time":"2021-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1648342800,"time":"2022-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1667091600,"time":"2022-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1679792400,"time":"2023-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1698541200,"time":"2023-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1711846800,"time":"2024-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1729990800,"time":"2024-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1743296400,"time":"2025-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1761440400,"time":"2025-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1774746000,"time":"2026-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1792890000,"time":"2026-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1806195600,"time":"2027-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1824944400,"time":"2027-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1837645200,"time":"2028-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1856394000,"time":"2028-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1869094800,"time":"2029-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1887843600,"time":"2029-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1901149200,"time":"2030-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1919293200,"time":"2030-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1932598800,"time":"2031-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1950742800,"time":"2031-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1964048400,"time":"2032-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1982797200,"time":"2032-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1995498000,"time":"2033-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2014246800,"time":"2033-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2026947600,"time":"2034-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2045696400,"time":"2034-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2058397200,"time":"2035-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2077146000,"time":"2035-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2090451600,"time":"2036-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2108595600,"time":"2036-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2121901200,"time":"2037-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2140045200,"time":"2037-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"}],"location":{"country_code":"DE","latitude":52.5,"longitude":13.366659999999996,"comments":"Germany (most areas)"}},"offset":3600,"timestamp":1545278400},"name":"cat"},{"id":2,"uniqueId":"3413123523","timestamp":{"timezone":{"name":"Europe\/Berlin","transitions":[{"ts":-9223372036854775808,"time":"-292277022657-01-27T08:29:52+0000","offset":3208,"isdst":false,"abbr":"LMT"},{"ts":-2147483648,"time":"1901-12-13T20:45:52+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1693706400,"time":"1916-04-30T22:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1680483600,"time":"1916-09-30T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1663455600,"time":"1917-04-16T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1650150000,"time":"1917-09-17T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-1632006000,"time":"1918-04-15T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-1618700400,"time":"1918-09-16T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-938905200,"time":"1940-04-01T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-857257200,"time":"1942-11-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-844556400,"time":"1943-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-828226800,"time":"1943-10-04T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-812502000,"time":"1944-04-03T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-796777200,"time":"1944-10-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-781052400,"time":"1945-04-02T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-776563200,"time":"1945-05-24T00:00:00+0000","offset":10800,"isdst":true,"abbr":"CEMT"},{"ts":-765936000,"time":"1945-09-24T00:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-761180400,"time":"1945-11-18T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-757386000,"time":"1945-12-31T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-748479600,"time":"1946-04-14T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-733273200,"time":"1946-10-07T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-717631200,"time":"1947-04-06T02:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-714610800,"time":"1947-05-11T01:00:00+0000","offset":10800,"isdst":true,"abbr":"CEMT"},{"ts":-710380800,"time":"1947-06-29T00:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-701910000,"time":"1947-10-05T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-684975600,"time":"1948-04-18T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-670460400,"time":"1948-10-03T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":-654130800,"time":"1949-04-10T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":-639010800,"time":"1949-10-02T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":315529200,"time":"1979-12-31T23:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":323830800,"time":"1980-04-06T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":338950800,"time":"1980-09-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":354675600,"time":"1981-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":370400400,"time":"1981-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":386125200,"time":"1982-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":401850000,"time":"1982-09-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":417574800,"time":"1983-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":433299600,"time":"1983-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":449024400,"time":"1984-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":465354000,"time":"1984-09-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":481078800,"time":"1985-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":496803600,"time":"1985-09-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":512528400,"time":"1986-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":528253200,"time":"1986-09-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":543978000,"time":"1987-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":559702800,"time":"1987-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":575427600,"time":"1988-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":591152400,"time":"1988-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":606877200,"time":"1989-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":622602000,"time":"1989-09-24T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":638326800,"time":"1990-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":654656400,"time":"1990-09-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":670381200,"time":"1991-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":686106000,"time":"1991-09-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":701830800,"time":"1992-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":717555600,"time":"1992-09-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":733280400,"time":"1993-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":749005200,"time":"1993-09-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":764730000,"time":"1994-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":780454800,"time":"1994-09-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":796179600,"time":"1995-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":811904400,"time":"1995-09-24T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":828234000,"time":"1996-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":846378000,"time":"1996-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":859683600,"time":"1997-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":877827600,"time":"1997-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":891133200,"time":"1998-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":909277200,"time":"1998-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":922582800,"time":"1999-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":941331600,"time":"1999-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":954032400,"time":"2000-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":972781200,"time":"2000-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":985482000,"time":"2001-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1004230800,"time":"2001-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1017536400,"time":"2002-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1035680400,"time":"2002-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1048986000,"time":"2003-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1067130000,"time":"2003-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1080435600,"time":"2004-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1099184400,"time":"2004-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1111885200,"time":"2005-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1130634000,"time":"2005-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1143334800,"time":"2006-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1162083600,"time":"2006-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1174784400,"time":"2007-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1193533200,"time":"2007-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1206838800,"time":"2008-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1224982800,"time":"2008-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1238288400,"time":"2009-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1256432400,"time":"2009-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1269738000,"time":"2010-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1288486800,"time":"2010-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1301187600,"time":"2011-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1319936400,"time":"2011-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1332637200,"time":"2012-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1351386000,"time":"2012-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1364691600,"time":"2013-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1382835600,"time":"2013-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1396141200,"time":"2014-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1414285200,"time":"2014-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1427590800,"time":"2015-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1445734800,"time":"2015-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1459040400,"time":"2016-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1477789200,"time":"2016-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1490490000,"time":"2017-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1509238800,"time":"2017-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1521939600,"time":"2018-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1540688400,"time":"2018-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1553994000,"time":"2019-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1572138000,"time":"2019-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1585443600,"time":"2020-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1603587600,"time":"2020-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1616893200,"time":"2021-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1635642000,"time":"2021-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1648342800,"time":"2022-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1667091600,"time":"2022-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1679792400,"time":"2023-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1698541200,"time":"2023-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1711846800,"time":"2024-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1729990800,"time":"2024-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1743296400,"time":"2025-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1761440400,"time":"2025-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1774746000,"time":"2026-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1792890000,"time":"2026-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1806195600,"time":"2027-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1824944400,"time":"2027-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1837645200,"time":"2028-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1856394000,"time":"2028-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1869094800,"time":"2029-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1887843600,"time":"2029-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1901149200,"time":"2030-03-31T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1919293200,"time":"2030-10-27T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1932598800,"time":"2031-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1950742800,"time":"2031-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1964048400,"time":"2032-03-28T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":1982797200,"time":"2032-10-31T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":1995498000,"time":"2033-03-27T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2014246800,"time":"2033-10-30T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2026947600,"time":"2034-03-26T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2045696400,"time":"2034-10-29T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2058397200,"time":"2035-03-25T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2077146000,"time":"2035-10-28T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2090451600,"time":"2036-03-30T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2108595600,"time":"2036-10-26T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"},{"ts":2121901200,"time":"2037-03-29T01:00:00+0000","offset":7200,"isdst":true,"abbr":"CEST"},{"ts":2140045200,"time":"2037-10-25T01:00:00+0000","offset":3600,"isdst":false,"abbr":"CET"}],"location":{"country_code":"DE","latitude":52.5,"longitude":13.366659999999996,"comments":"Germany (most areas)"}},"offset":3600,"timestamp":1545131760},"name":"frog"}]
我不知道为什么会这样,但是我的数据表也无法识别此字段:
DataTables警告:表ID = DataTables_Table_0-请求的未知 第0行第1列的参数“时间戳”。有关的更多信息 此错误,请参阅http://datatables.net/tn/4
答案 0 :(得分:0)
您未指定Symfony的版本。
如果您的Symfony版本> = 3.1,只需使用DateTimeNormalizer:
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
$serializer = new Serializer(array(new DateTimeNormalizer('U'), new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
使用U
格式获取时间戳,或指定所需的format,例如Y/m/d