-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
8u45, 9
-
x86_64
-
linux_ubuntu
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.
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.