Wednesday 27 June 2012

Covert Seconds to HH:mm:ss Format

Here the below gettimeFormat() method is taken no of seconds as input and retuns "HH:mm:ss" As Output

public String gettimeFormat(int noofseconds) {
TimeZone timeZone = TimeZone.getTimeZone("UTC");
SimpleDateFormat sdateFormat = new SimpleDateFormat("HH:mm:ss");
sdateFormat.setTimeZone(timeZone);
String formatedTime = sdateFormat.format(new Date(noofseconds));
return formatedTime;
}

No comments:

Post a Comment

Android SQLite Database Viewer or Debuging with Stetho

Every Android Developer uses SQLite Database to store data into the Android Application data. But to view the data in SQLite have a lot of...