Java Utils – Code to finding Today’s Date

Java Utils – Code to finding Today’s Date

Use Case: To find today’s date, using Java Utils package

Answer/Solution: To use a Date object’s toString( ) method.

Java Utils - Date

Java Utils – Date

To get today’s date and time is to construct a Date object with no arguments in the constructor call, and call its toString( ) method.

 new java.util.Date( )

Executable Code:

date1

Console Output:

Tue Oct 14 23:17:20 EDT 2014

——————————————————————————–

About TechnoStixs.com

TechnoStixs

TechnoStixs.com is a dedicated weblog for Java/J2EE and web developers. We take pride in our work. Every publication is carefully analyzed, written and tested to ease the understanding of the topic or subject.

We cover Java Core Technologies, eCommerce, J2EE Frameworks, Web Service, Build Tools, Unit Test Frameworks and Others.

940 total views, 1 views today

Add comment