Example usage for android.text.format DateUtils isToday

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

Introduction

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

Prototype

public static boolean isToday(long when) 

Source Link

Usage

From source file:de.vanita5.twittnuker.util.Utils.java

@SuppressWarnings("deprecation")
public static String formatSameDayTime(final Context context, final long timestamp) {
    if (context == null)
        return null;
    if (DateUtils.isToday(timestamp))
        return DateUtils.formatDateTime(context, timestamp,
                DateFormat.is24HourFormat(context) ? DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_24HOUR
                        : DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_12HOUR);
    return DateUtils.formatDateTime(context, timestamp, DateUtils.FORMAT_SHOW_DATE);
}