Friday, May 21, 2010

How i use java to find the time on a user computer?

Im making a 7 segment digital display with java.





Its basically going to be lines drawing out the seven segment display.





How do i code it to get the time and then display that time in java





I have the code for displaying the numbers but how do i get it to get the time from the computer and then take the user time and display it?








THANKS FOR ANY HELP!

How i use java to find the time on a user computer?
java.util.Calendar.getInstance() returns an instance of a Calendar. Then with that instance you use get(field) to retrieve the fields you need. Some values for field are:


Calendar.YEAR


Calendar.MONTH


Calendar.DAY_OF_MONTH


Calendar.HOUR_OF_DAY


Calendar.MINUTE
Reply:http://www.java.com/en/download/installe...





http://www.time.gov/timezone.cgi?Pacific...


No comments:

Post a Comment