Hans Wurst Hans Wurst -4 years ago 110
Android Question

How to get the current Time

How to get the current time in Android?

When i use

int hours = java.sql.Time.this.getHours();


i get the error:

No enclosing instance of the type Time is accessible in scope

Answer Source
int hours = new Time(System.currentTimeMillis()).getHours();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download