-1
if (!DateFormat.is24HourFormat(this.context))
{
sB.append(DateFormat.format("MMM dd  h:mm a", callingDate));
}
else {
sB.append(DateFormat.format("MMM dd  H:mm", callingDate));
}

In first condition it is showing expected result (Jan 29 9:27) ,but in second condition it is showing (Jan 29 H:27) result ,why it is showing capital H instead of hour in only Samsung S2 device.

I have tested in other samsung device like s3, s4 ,s5 it is showing expected result , please guide me. Thanks

Tushar Gogna
  • 4,963
  • 6
  • 31
  • 42

2 Answers2

1

suggested to use SimpleDateFormat instead of DateFormat. So Post and Post2

Community
  • 1
  • 1
M D
  • 47,665
  • 9
  • 93
  • 114
0

Plz coorect the api's as below :

if (!DateFormat.is24HourFormat(this.context))
{
sB.append(DateFormat.format("MM dd  hh:mm a", callingDate));
}
else {
sB.append(DateFormat.format("MM dd  HH:mm", callingDate));
}
KOTIOS
  • 11,177
  • 3
  • 39
  • 66