datetime - How is the Date/Time formatted in Android notifications? -


what android os use format dates , times in notifications?

i assumed used dateutils.formatsamedaytime, not that. logic appears same, format not same. instance, notification show me "2013-08-06" (based on system settings) when formatsamedaytime returns "8/6/13".

edit:

here's current solution. best?

public static final charsequence formatsamedaytimecustom(context context, long then) {     if (dateutils.istoday(then)) {         return dateformat.gettimeformat(context).format(new date(then));     }     else {         final string format = settings.system.getstring(context.getcontentresolver(), settings.system.date_format);         return new simpledateformat(format).format(new date(then));     } } 


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -