Is there a way to change Rails default timestamps to Y-m-d H:i:s (instead of Y-m-d H:i:s.u) or have laravel ignore decimal portion of Y-m-d H:i:s.u?

后端 未结 3 455
萌比男神i
萌比男神i 2021-01-25 03:49

I have two applications using the same postgres DB. A laravel application and a rails application. The current data in the DB is in Y-m-d H:i:s format but whenever

3条回答
  •  -上瘾入骨i
    2021-01-25 04:13

    you can set Time::DATE_FORMATS[:db] in application.rb

    Time::DATE_FORMATS[:db] = "Y-m-d H:i:s.u"
    

    looks more at strftime format

提交回复
热议问题