这是我的疑问:
$casesData = $this->getEntityManager()->getRepository('Cases\Entity\Cases')
->createQueryBuilder('cases')
->select('cases.CaseId',
'cases.CreatedDate',
'cases.LeadId',
'cases.InquiryID',
'cases.FirstName',
'cases.LastName',
'cases.CityDoc1',
'cases.StateDoc1',
'cases.SSN',
'cases.Status',
'cases.CaseManagerId',
'users.first_name'
);
cases.CreatedDate
目前有"美国加拿大" timezone,现在我想根据时区下拉值进行转换,我无法按照上述查询找到任何转换时区的解决方案,请帮助我。
答案 0 :(得分:0)
Actually with query builder you can't change the time zone, you have to use loop as doctrine return datetime object than you can modify the time as you wish
foreach($data as item){
$date = $item['CreatedDate']->modify('....')
}