Android Date Relative Format getRelativeDate(Date date)

Here you can find the source of getRelativeDate(Date date)

Description

get Relative Date

License

Open Source License

Declaration

public static String getRelativeDate(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Date;
import android.text.format.DateUtils;

public class Main {
    public static String getRelativeDate(Date date) {
        return DateUtils.getRelativeTimeSpanString(date.getTime(),
                new Date().getTime(), DateUtils.DAY_IN_MILLIS,
                DateUtils.FORMAT_ABBREV_RELATIVE).toString();
    }/*from  w ww  .  j a  v a2  s .co m*/
}

Related

  1. formatRelativeTime(String fullRelativeDate)
  2. getRelativeTimeofTweet(String tweetCreatedAt)
  3. relativeDate(String dateString)
  4. humanFriendlyDate(Date date)
  5. dateIsBetweenTwoDates(String begin, String end)
  6. getHumanReadableDateDiff(Date pastDate, boolean unknownIfNull)