当前位置:首页 > 数据库 > 正文

mysql 获取当前时间戳

mysql 获取当前时间为select now()
运行结果2012-09-05 17:24:15
mysql 获取当前时间戳为select unix_timestamp(now()) 
运行结果:
unix_timestamp(now())
1346836984  

1. current_timestamp

2. current_time

3.current_data

 

4. now()

5. curdate()

6.curtime()

 

将当前时间插入数据库

insert into t_login(user_id,login_time) values (1,CURRENT_TIMESTAMP);