Rails default timestamps in PHP
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.
精彩评论