Use Unix timestamp in Doctrine Timestampable

前端 未结 3 1748
囚心锁ツ
囚心锁ツ 2021-02-01 11:14

How do I use Unix timestamps with the Doctrine Timestampable behavior? I found the following code snippet here, but I\'d rather not manually add this everywhere:



        
3条回答
  •  离开以前
    2021-02-01 11:29

    Its very simple. Just create a Setter method for your field with a datetime parameter and use the tostring method to store it as integer.

提交回复
热议问题