Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4097405

DateFormat Short, UK not parsing "05/12/2010"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.1.6
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Introduced In Build:
      1.1.6
    • Introduced In Version:
    • Resolved In Build:
      1.1.6
    • CPU:
      x86
    • OS:
      windows_95
    • Verification:
      Verified

      Backports

        Description



        Name: dgC58589 Date: 12/05/97


        I don't know whether it is a bug or not.
        But I want to convert a string of "05/12/2010" to
        date. Kindly help me in this.

        import java.util.*;
        import java.text.*;

        class datetest
        {
          public static void main(String[] args) throws ParseException
          {
                Date aDate;
                String test;
                DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK);
                aDate = fmt.parse("05/12/2010");
                System.out.println("The Date String is : "+fmt.format(aDate));
                System.out.println("The Date String is : "+aDate);
          }
        }


        The output I got is "The Date String is : Mon Jan 05 00:00:00 GMT +00:00 1920

        Other outputs are :
        The Date String is : 05/12/10
        The Date String is : Sun Dec 04 19:00:00 EST 3910


        (Review ID: 21409)
        ======================================================================
        sandy.labrasca@eng 1999-01-12
        see more info...

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                bcbeck Brian Beck (Inactive)
                Reporter:
                dgrahamcsunw David Graham-cumming (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: