Example usage for android.text.format DateUtils getRelativeTimeSpanString

List of usage examples for android.text.format DateUtils getRelativeTimeSpanString

Introduction

In this page you can find the example usage for android.text.format DateUtils getRelativeTimeSpanString.

Prototype

public static CharSequence getRelativeTimeSpanString(long startTime) 

Source Link

Document

Returns a string describing the elapsed time since startTime.

Usage

From source file:com.iiordanov.runsoft.bVNC.RemoteCanvasActivity.java

public String getRegdateRelative() {
    String label = DateUtils.getRelativeTimeSpanString(System.currentTimeMillis()).toString();
    if (label.equals("0 ") || label.equals("0 ?")) {
        label = " ";
    }//from w  ww.ja  v a 2s  .c om
    if (label.contains("")) {
        return DateFormat.format("yyyy.MM.dd. aahh:mm", System.currentTimeMillis()).toString();
    }
    return label;
}