I wanted to display date and time at a particular instance in my android app.I used the following piece of code to achieve it.
Date now = new Date();
final String time = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.SHORT).format(now);
Now the problem is that on emulator it shows dates and time in a perfect format just the way i wanted
Sep 1,2012 10:30pm
But when i run my app on phone it displays date and time on the following format:
2012 9 1 10:30
Can anyone please tell me why im getting different behavior on emulator and on phone? and what should i do in order to achieve the same result on phone as im getting on emulator?
Thank You!!