24

为什么阿里巴巴禁止把SimpleDateFormat定义为static类型的?-java架构师1的博客

 5 years ago
source link: http://blog.51cto.com/13981400/2346305
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在日常开发中,我们经常会用到时间,我们有很多办法在Java代码中获取时间。但是不同的方法获取到的时间的格式都不尽相同,这时候就需要一种格式化工具,把时间显示成我们需要的格式。最常用的方法就是使用SimpleDateFormat类。这是一个看上去功能比较简单的类,但是,一旦使用不当也有可能导致很大的问题。在阿里巴巴Java开发手册中,有如下明确规定:那么,本文就围绕SimpleDateFormat的

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK