杂记

File.separator

public static final String separator = "" + separatorChar;

为了适应跨平台,在 UNIX 系统上,此字段的值为 '/';在 Microsoft Windows 系统上,它为 '\'。

Mysql的timestamp与datetime

储存

  TIMESTAMP

  1.4个字节储存(Time stamp value is stored in 4 bytes)

  2.值以UTC格式保存( it stores the number of milliseconds)

  3.时区转化 ,存储时对当前的时区进行转换,检索时再转换回当前的时区。

  datetime

  1.8个字节储存(8 bytes storage)

  2.实际格式储存(Just stores what you have stored and retrieves the same thing which you have stored.)

  3.与时区无关(It has nothing to deal with the TIMEZONE and Conversion.)

参考:http://lhdeyx.blog.163.com/blog/static/318196972011230113645715/

new Date()

final Date currentDate = new Date(System.currentTimeMillis());比

Date nowTime = new Date();效率高

转载于:https://my.oschina.net/u/2342541/blog/724615

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值