Create java.util.TimeZone via string in GMT+00:00 format - Android java.util

Android examples for java.util:Timezone

Description

Create java.util.TimeZone via string in GMT+00:00 format

Demo Code

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

public class Main {

  public static String formatTime(long millisecond) {
    DateFormat format = new SimpleDateFormat("mm:ss");
    format.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
    return format.format(millisecond);
  }/*from w w w  .jav a  2  s  .  com*/

}

Related Tutorials