在sql server里面字段类型是 datetime , 默认值可以用 getdate() , 或者 CURRENT_TIMESTAMP. 注意不能给timestamp类型的字段设置default 值、
mysql 里面是 只能给timestamp类型的字段设置default值.CURRENT_TIMESTAMP。 注意datatime 类型的字段不能设置成 CURRENT_TIMESTAMP. (不同于php的时间戳)
这样插入的时候就可以得到当前的时间。sqlite 下面,请看官方文档
http://www.sqlite.org/lang_createtable.html
The DEFAULT constraint specifies a default value to use when doing an INSERT. The value may be NULL, a string constant or a number. Starting with version 3.1.0, the default value may also be one of the special case-independant keywords CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP. If the value is NULL, a string constant or number, it is literally inserted into the column whenever an INSERT statement that does not specify a value for the column is executed. If the value is CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP, then the current UTC date and/or time is inserted into the columns. For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, YYYY-MM-DD. The format for CURRENT_TIMESTAMP is "YYYY-MM-DD HH:MM:SS".