Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Format + Float    [ Add a report in this area ]  
Report #:  96844   Status: Closed
TFormatSettings.TranslateDateFormat returns an incorrect result with Delphi XE.
Project:  Delphi Build #:  15.0.3953.35171
Version:    15.1 Submitted By:   Serge (Developer Express Support)
Report Type:  Basic functionality failure Date Reported:  7/29/2011 3:03:58 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   285550
Resolution: Fixed (Resolution Comments) Resolved in Build: : 16.0.4230.42231
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The TFormatSettings.TranslateDateFormat function does not take into account that the Date Format can contain quoted date separators that are simply added to the date.

[Code]
-----
procedure TForm1.FormCreate(Sender: TObject);
begin
  Self.Caption := DateToStr(Now);
end;
-----

[Result]
M.d.yyyy 'y.'  --> 7.29.2011 y/
Steps to Reproduce:
Steps-to-reproduce for Windows 7 Enterprise:

1. Go to the Windows "Start" menu.
2. Evoke the "Control Panel" window.
3. Choose the "Clock, Language, and Region" option.
4. Choose "Change the date, time, or number format". This will evoke the "Region and Language" dialog.
5. Click the "Additional Settings..." button.
6. Go to the "Date" tab.
7. Change the Short Date value in the Date formats group to the following:
    M.d.yyyy 'y.'
8. Apply changes.
9. Run the attached project. The last character in the Form's caption is '/' instead of  '.'
Workarounds
None
Attachment
FormatSettings problem.zip
Comments

Gennadie Zuev at 6/9/2012 3:25:01 AM -
Bug still not fixed in Delphi XE2 Update 4 (16.0.4429.46931).

Having the following string for long date format in regional settings applet

d MMMM yyyy '?.'

gives incorrect FormatDateTime('dddddd', Now) output

9 ???? 2012 ?/

Gennadie Zuev at 6/9/2012 3:28:09 AM -
Oops, russian letters not visible... Should read like this:

Bug still not fixed in Delphi XE2 Update 4 (16.0.4429.46931).

Having the following string for long date format in regional settings applet

d MMMM yyyy 'y.'

gives incorrect FormatDateTime('dddddd', Now) output

9 June 2012 y/

Tomohiro Takahashi at 6/9/2012 9:20:13 PM -
> d MMMM yyyy 'y.'
> gives incorrect FormatDateTime('dddddd', Now) output
> 9 June 2012 y/
Is your issue same as QC#88894, QC#104942 ?


anyway, I will check the internal status of this report.

Tomohiro Takahashi at 6/10/2012 5:45:52 PM -
QC#88894 was closed as 'Test Case Error'.
However, the issue is opened as QC#104942, again.

Server Response from: ETNACODE01