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

Long time format for Great Britain is incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u45, 9
    • Fix Version/s: tbd
    • Component/s: globalization
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux_ubuntu

      Description

      A DESCRIPTION OF THE REQUEST :
      When formatting a "full" style date for the GB locale, the phrase "o'clock" is used erroneously.


      JUSTIFICATION :
      The phrase "o'clock" only makes sense on the hour, with a 12-hour number, such as "9 o'clock in the morning". It is not appropriate to use it when minutes or seconds are present, or with a 24-hour time.

      To fix this, the phrase "o'clock" should be removed from this format string.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      SimpleDateFormat.getTimeInstance(DateFormat.FULL, Locale.UK).format(new Date())
      > 17:25:43 BST
      ACTUAL -
      SimpleDateFormat.getTimeInstance(DateFormat.FULL, Locale.UK).format(new Date())
      > 17:25:43 o'clock BST

      ---------- BEGIN SOURCE ----------
      import java.util.*;
      import java.lang.*;
      import java.text.*;

      class BritishTime
      {
      public static void main (String[] args) throws java.lang.Exception
      {
      String result = SimpleDateFormat.getTimeInstance(DateFormat.FULL, Locale.UK).format(new Date());
      System.out.println(result);
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Using a custom date format string instead of the FULL date style.

        Attachments

          Activity

            People

            Assignee:
            ljiang Leo Jiang (Inactive)
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: