Mysql 查询中转换参数格式

[关于时间戳的转换]

1、将时间转换为时间戳

select unix_timestamp('2009-10-26 10-06-07');


2、将时间戳转换为时间

select from_unixtime(1256540102);


[关于IP地址转换]

1、将IP地址转化为数字

select inet_aton('210.30.0.103');


2、将数字转化为IP地址

select inet_ntoa(3525181543);

猜你喜欢

转载自zzz200100.iteye.com/blog/2348830