开发者

How do I capture the time at which an entry was added to the database?

using MSSQL 2008 and PHP, is it possible to capture the time at which a record was added to the database?

I thought the built in 'Timestamp' data type did this, but I'm getting some really weird hex like thing...

0x00000000000007D3

Any ideas ho开发者_运维知识库w?


You can use a datetime column with a default value getdate().

create table YourTable
(
  Created datetime default getdate()
)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜