System time in JAVA
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rui_Zamith
Posted On:   Sunday, November 14, 2004 10:07 AM

Is there any class that returns the system time/date of the computer where we're working on, and convert it to an "int" or "double" type?

I dind't find the answer to this question over this forum.
Thanks!

RZ

Re: System time in JAVA

Posted By:   Stephen_Ostermiller  
Posted On:   Sunday, November 14, 2004 02:49 PM

There are a couple ways to do this:


long t = System.currentTimeMillis();


or


long t = (new Date()).getTime();


or


long t = (new Calendar()).getTimeInMillis();
About | Sitemap | Contact