Here you can find the source of format(long offsetMillis)
private static String format(long offsetMillis)
//package com.java2s; public class Main { /**/* www. ja va 2s . c om*/ * quick & dirty format */ private static String format(long offsetMillis) { offsetMillis /= 60 * 1000; String sign = "+"; if (offsetMillis < 0) { offsetMillis = -offsetMillis; sign = "-"; } return sign + String.valueOf(offsetMillis / 60) + ":" + String.valueOf(100 + (offsetMillis % 60)).substring(1, 3); } }