Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311414

Summary: TVT36:TCT110: CHT: The year format should be yyyy
Product: [Tools] Data Tools Reporter: CDE Administration <cdeadmin>
Component: SQL Editor FrameworkAssignee: Brian Payton <bpayton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bpayton, camle, kitlo
Version: 1.8   
Target Milestone: 1.8   
Hardware: PC   
OS: Windows 7   
URL: 110
Whiteboard:
Attachments:
Description Flags
08.000.500_year_format.gif
none
110_08.000.500_wrong_date_format.gif
none
Patch for plugins o.e.d.sqltools.result and result.ui
none
fixed_TCT#110_08.000.500_year_format_0520.gif
none
110_08.000.500_wrong_date_format_Fixed.gif none

Description CDE Administration CLA 2010-05-03 14:36:26 EDT
<response_by> Lisa Chang at 2010.05.03.04.15.06 </response_by>
Hi,

The date format should be yyyy/mm/dd, not yy/mm/dd for CHT. This will let CHT user confused. Thank you!!

step:
1)  Start Eclipse and change the Perspective to Database Development Perspective from Window->Open Perspective->Other?
2)  When the Database Development Perspective opens, verify the Data Source Explorer (DSE) opens.  It should contain the Databases folder
3)  Open the Project Explorer View by selecting Window -> Show View -> Other... expand the General folder and select Project Explorer
4)  Double click your test SQL file from Project Explorer view if it is not already open in the SQL Editor
5)  Return to the SQL Editor.  Run the query in the editor by right-clicking and selecting Execute All.  A result should appear in the SQL Results view.

<response_by> rewagner at 2010.05.03.10.36.27 </response_by>
This article was reassigned from Category:''TVT/Testing,Test Cases Issues''.
Comment 1 CDE Administration CLA 2010-05-03 14:36:38 EDT
Created attachment 166844 [details]
08.000.500_year_format.gif
Comment 2 CDE Administration CLA 2010-05-03 14:36:43 EDT
<cde:tctdetail>
Testcase: 08.000.500
Project: WSW36
Component: Xfer - Data Tools/SQL Editor Framework
Priority: 2
Subject: CHT: The year format should be yyyy
Article ID: 110
Originator: lisa_chang@hq.iisi.com.tw
</cde:tctdetail>
Comment 3 CDE Administration CLA 2010-05-03 17:46:30 EDT
<response_by> rewagner at 2010.05.03.16.39.45 </response_by>
Changing status to working
Comment 4 CDE Administration CLA 2010-05-03 21:45:28 EDT
<response_by> Ma Xiao Long at 2010.05.03.20.24.07 </response_by>
Same for CHS.
Comment 5 CDE Administration CLA 2010-05-03 21:45:30 EDT
Created attachment 166893 [details]
110_08.000.500_wrong_date_format.gif
Comment 6 CDE Administration CLA 2010-05-05 10:20:33 EDT
<response_by> rewagner at 2010.05.05.09.15.46 </response_by>
Must-Fix: Yes
Comment 7 Brian Payton CLA 2010-05-12 22:02:03 EDT
Upon investigating, we found that the problem is due to the way the date formatter class we're using (java.text.SimpleDateFormat, or rather, com.ibm.icu.SimpleDateFormat) formats dates by default.  For the US English locale, a date/time value is formatted as mm/dd/yy hh:mm.  For Chinese, it formats as yy/mm/dd <Chinese chars> hh:mm.

A better approach would be to get a date/time formatter class like this:

  DateFormat FORMATTER = DateFormat.getDateTimeInstance();

For a Chinese locale, this formatter formats a date/time like this:

  yyyy-mm-dd <Chinese chars> hh:mm:ss

and that looks much better.

However, a side-effect is that the US English format now looks like this:

  May 12, 2010 6:12:22 PM

I'll think about it a bit more, but personally I like the "May 12" style date format better than 5/12/10 6:12 PM.
Comment 8 CDE Administration CLA 2010-05-13 05:06:11 EDT
<response_by> Lisa Chang at 2010.05.13.04.01.06 </response_by>
lower the priority as it is not a blocking issue
Comment 9 CDE Administration CLA 2010-05-13 05:06:13 EDT
<cde:tctdetail>
Testcase: 08.000.500
Project: WSW36
Component: Xfer - Data Tools/SQL Editor Framework
Priority: 3
Subject: CHT: The year format should be yyyy
Article ID: 110
Originator: lisa_chang@hq.iisi.com.tw
</cde:tctdetail>
Comment 10 Brian Payton CLA 2010-05-13 15:29:01 EDT
Created attachment 168454 [details]
Patch for plugins o.e.d.sqltools.result and result.ui
Comment 11 Brian Payton CLA 2010-05-13 15:38:34 EDT
Along with the change in ResultConstants to use DateFormat.getDateTimeInstance(), the patch also contains a change to the code in the ResultHistorySection class that sorts the SQL result history by the execution date to not translate the result history dates from string form to Date form.  The translation is not needed, since the history entry already contains the Date form as well as the string form of the execution date.  Besides improving the performance of sorting the result entries, this will also avoid a situation where after installing this fix, you might have result history entries in both the old date format and the new date format, and the translation from string form to Date form for the old entries would probably fail.
Comment 12 Brian Payton CLA 2010-05-13 15:49:50 EDT
Checked in fix, tagged to v201005140345.
Comment 13 CDE Administration CLA 2010-05-20 03:17:03 EDT
<response_by> Ma Xiao Long at 2010.05.20.01.53.17 </response_by>
We checked in build 20100518-2000-nl1 for CHS, however, it looks as same as what we reported.
Comment 14 CDE Administration CLA 2010-05-20 03:22:38 EDT
<response_by> Ma Xiao Long at 2010.05.20.02.13.08 </response_by>
Not fixed in build 20100519-1300-nl1 for CHS.
Comment 15 CDE Administration CLA 2010-05-20 07:01:13 EDT
<response_by> Lisa Chang at 2010.05.20.05.42.53 </response_by>
Hi,

build 20100519-1300-nl1 for CHT.
It seems fixed for CHT for the new generated data, but not fixed for the old data. Please kindly check this issue. Thank you!!
Comment 16 CDE Administration CLA 2010-05-20 07:01:16 EDT
Created attachment 169309 [details]
fixed_TCT#110_08.000.500_year_format_0520.gif
Comment 17 CDE Administration CLA 2010-05-21 13:50:59 EDT
<response_by> Kathy Li at 2010.05.21.12.40.25 </response_by>
it's not fixed for CHS, and CHT also has some issues. please take a look at it again. thanks
Comment 18 Brian Payton CLA 2010-05-21 19:24:20 EDT
The old entries are stored in string format.  We're not going to reformat or regenerate old entries, so "No Plan to Fix" for that one.
Comment 19 Brian Payton CLA 2010-05-21 19:25:09 EDT
What is the problem for CHS?  Please attach an image (with new entries).
Comment 20 CDE Administration CLA 2010-05-21 19:50:33 EDT
<response_by> Ma Xiao Long at 2010.05.21.18.36.08 </response_by>
CHS has same problem as CHT, pls refer to our attachment 110 [details]_08.000.500_wrong date format.gif.
Comment 21 CDE Administration CLA 2010-05-21 23:35:36 EDT
<response_by> Ma Xiao Long at 2010.05.21.22.28.35 </response_by>
I changed the Regional and Language setting in Control Panel to set it into zh_CN, but the problem still exists.
Comment 22 CDE Administration CLA 2010-05-25 11:21:06 EDT
<response_by> Kathy Li at 2010.05.25.10.15.36 </response_by>
Hi Eric,

As Brian explained below, "The old entries are stored in string format. We're not going to reformat or regenerate old entries, so "No Plan to Fix" for that one.", we need to defer this to future release. Ok with you?

Thanks

Kathy
Comment 23 CDE Administration CLA 2010-05-25 23:50:36 EDT
<response_by> Ma Xiao Long at 2010.05.25.22.46.33 </response_by>
Hi Kathy,

It's OK for CHS to defer, thanks!
Comment 24 CDE Administration CLA 2010-05-26 00:35:30 EDT
Created attachment 169930 [details]
110_08.000.500_wrong_date_format_Fixed.gif