Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.text.format.DateUtils; import java.util.Date; public class Main { public static CharSequence getRelativeTimeSpanString(Context context, Date date) { if (date != null) return DateUtils.getRelativeTimeSpanString(context, date.getTime()); return ""; } }