Getting missmatch in datetime format using jms serializer and ISO8601

十年热恋 提交于 2019-12-05 07:21:24

This is a tough one, I've run into it before. I was using annotations so my fix looked like:

 @Serializer\Type("DateTime<'Y-m-d\TH:i:s.uT'>")

So I'm guessing yours is going to look like:

jms_serializer:
    handlers:
        datetime:
            default_format: 'Y-m-d\TH:i:s.uT'

Or you may have to add another slash in there before "TH" if jms reads yaml files differently than annotations.

Can't remember exactly why this happens, I just remember trying a hundred different combinations until one worked. At any rate, dates and times are hard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!