之前使用mysql存儲日期類型的數據用datetime,timestamp,現在把它存為int,對於表的數據量比較大的話,這樣節省空間
看下面表字段
看下查詢語句<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+U0VMRUNUIHVwdGltZSxGUk9NX1VOSVhUSU1FKHVwdGltZSkgRlJPTSBxbG1fdXJsYnJpZGdlcyA8YnI+CjwvcD4KPHA+PGltZyBzcmM9"http://www.2cto.com/uploadfile/Collfiles/20150619/2015061910120820.jpg" alt="\">
2.SELECT uptime,FROM_UNIXTIME(uptime) FROM qlm_urlbridges WHERE uptime>UNIX_TIMESTAMP("2015-06-01 00:00:00')
3.java把日期轉換
Integer itg = Integer.valueOf(Long.valueOf(new Date().getTime() / 1000).toString());