Here you can find the source of getUTCandRelativeDateFromElapsedTime( long elapsedTime)
public static String getUTCandRelativeDateFromElapsedTime( long elapsedTime)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import android.os.SystemClock; public class Main { public static String getUTCandRelativeDateFromElapsedTime( long elapsedTime) { try {/* w w w. j av a 2 s. c o m*/ SimpleDateFormat formatter = new SimpleDateFormat("dd/HH:mm:ss"); int flags = android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE; long curTime = System.currentTimeMillis(); long time = curTime - (SystemClock.elapsedRealtime() - elapsedTime); StringBuffer sb = new StringBuffer(); sb.append(formatter.format(new Date(time))); if (time <= curTime) { sb.append('{'); sb.append(android.text.format.DateUtils .getRelativeTimeSpanString( time, curTime, android.text.format.DateUtils.MINUTE_IN_MILLIS, flags).toString()); sb.append('}'); } return sb.toString(); } catch (java.lang.Throwable th) { return "TIME_ERROR"; } } }