例如有表table,table中有两个字段:name、makedate
1.oracle:
插入系统时间应为sysdate:
insertintotable(name,makedate)values('测试',sysdate);
2.Db2:
插入系统时间应为currenttimestamp并且makedate数据类型为timestamp
insertintotable(name,makedate)values('测试',currenttimestamp);
3.SqlServer:
插入系统时间应为GETDATE()
insertintotable(name,makedate)values('测试',GETDATE());
4.MySQL:
插入系统时间应:
now():以'yyyy-mm-ddhh:mm:ss'返回当前的日期时间,可以直接存到datetime字段中。
curdate():’yyyy-mm-dd’的格式返回今天的日期,可以直接存到date字段中。
insertintotable(name,makedate)values('测试',now());
转载于:https://blog.51cto.com/12575213/1323570