Hello,I'm trying to get current time format on Android device, but it returns always "h:nn AMPM". It doesn't matter if I set 24 hour format or 12 hour format on the device. Can someone advise what I'm doing wrong? Thank you in advance. MarosSample code:procedure TMainFrm.FormShow(Sender: TObject);var fs : TFormatSettings;begin fs := TFormatSettings.Create; ShowMessage(fs.ShortTimeFormat);end;
You're just showing the shorttimeformat itself. You should something like ShowMessage(DateToStr(now, fs));
Thank you for your answer, but the result is the same. If I use following routine
procedure TMainFrm.FormShow(Sender: TObject);var fs : TFormatSettings;begin fs := TFormatSettings.Create; ShowMessage(TimeToStr(now, fs));end;
the system always return time formatted as 12 hour format (e.g.: 5:11:47 PM) regardless I set 24 hour format on my device. It seems that formatsettings has problem to correctly read local date/time format. Can someone confirm this bug, or explain this strange behavior? Thank you in advance.
I once reported issues with the FormatSettings (but they did not do anything about it):
I get the felling that the FormatSettings do not work right in Android.
That's sad to hear. So, how can I format time in my app to be formatted the same way as is formatted in local Android system?