Here you can find the source of toInterval(long i)
static public final String toInterval(long i)
//package com.java2s; //License from project: Apache License public class Main { static public final String toInterval(long i) { if (i < 60) return i + "S"; if (i < 3600) return (i / 60) + "M"; return (i / 3600) + "H"; }/*from w ww . java 2s . c o m*/ }