Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there official documentation by Oracle saying we should not use java.util.Date in new project

I am writing new project in Java 8 in company. I have suggested to use Java 8 date time API but one of my co workers says that new Date time API works slow.

Is it true? Also I want to get some official documentation from Oracle which will mention that you should not use java.util.Date in new projects.

like image 459
user1321466 Avatar asked Jul 11 '17 11:07

user1321466


1 Answers

When java.time.* was developed, this phrase was what I wanted to add to java.util.Date:

"This class is now effectively deprecated by the Time Framework for Java."

It was in the source repository for a while, see here.

However, this change was rejected by Oracle, and as such there is no explicit deprecation of java.util.Date. However, all sensible developers should use Instant and java.time.* generally instead of java.util.Date.

like image 120
JodaStephen Avatar answered Nov 07 '22 02:11

JodaStephen