Java tutorial
//package com.java2s; //License from project: Open Source License import android.text.format.DateUtils; public class Main { public static String igFormattedDate(String timestamp) { /** * From the group discussion board. */ CharSequence relativeDateTimeString = DateUtils.getRelativeTimeSpanString(Long.parseLong(timestamp) * 1000, System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS); return relativeDateTimeString.toString().replaceAll("[^0-9]+", "s"); } }