开发者

Rails default timestamps in PHP

开发者 https://www.devze.com 2023-03-28 13:39 出处:网络
In rails created_at and updated_at timestamps are saved in the below开发者_StackOverflow社区 format.

In rails created_at and updated_at timestamps are saved in the below开发者_StackOverflow社区 format. What is it "called" and how can I replicated it in PHP?

2011-07-21 15:34:58.885171+0000

Thankful for all input!


I'm not entirely sure what exactly that format is called, but PHP doesn't have a predefined constant for it, so you need to create it yourself:

date('Y-m-d H:i:s.uO')

I seem to vaguely remember that .u will always equal .00000 in current PHP versions though.

0

精彩评论

暂无评论...
验证码 换一张
取 消