Grupos de Google ya no admite publicaciones ni suscripciones nuevas de Usenet. El contenido anterior sigue visible.

date(1) default format changed between 10.3 and 11.0-BETA3

1 vista
Ir al primer mensaje no leído

Mark Martinec

no leída,
3 ago 2016, 7:24:35 p.m.3/8/16
para
Is it normal/expected/documented that the date(1) command in 11.0
now produces a timestamp in substantially different format
in an "en_US.UTF-8" locale (long names, commas, 12 vs. 24h hour time):

Thursday, August 4, 2016 at 12:50:43 AM CEST
vs:
Thu Aug 4 00:52:29 CEST 2016


Setting LC_TIME does not help:

$ LC_TIME="C" date
Thursday, August 4, 2016 at 01:13:37 AM CEST

although LC_ALL="C" _does_ help.


This is funny too, especially regarding commas:
$ LC_ALL="en_GB.UTF-8" date
Thursday 4 August 2016 at 01:16:45 CEST
$ LC_ALL="en_US.UTF-8" date
Thursday, August 4, 2016 at 01:16:54 AM CEST


The date(1) man page states:
The date utility is expected to be compatible with IEEE Std 1003.2
(“POSIX.2”).
What does POSIX.2 say about date(1) following a locale?

======
11.0-BETA3:

$ date
Thursday, August 4, 2016 at 12:50:43 AM CEST

$ uname -a
FreeBSD xxx.ijs.si 11.0-BETA3 FreeBSD 11.0-BETA3 #0 r303469: Fri Jul 29
02:27:28 UTC 2016
ro...@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

$ locale
LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8

======
10.3-RELEASE-p6 :

$ date
Thu Aug 4 00:52:29 CEST 2016

$ freebsd-version
10.3-RELEASE-p6

$ uname -a
FreeBSD yyy.ijs.si 10.3-RELEASE-p4 FreeBSD 10.3-RELEASE-p4 #0: Sat May
28 12:23:44 UTC 2016
ro...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64

$ locale
LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Mark
_______________________________________________
freebsd...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Julian Elischer

no leída,
3 ago 2016, 10:32:56 p.m.3/8/16
para
On 4/08/2016 7:24 AM, Mark Martinec wrote:
> Is it normal/expected/documented that the date(1) command in 11.0
> now produces a timestamp in substantially different format
> in an "en_US.UTF-8" locale (long names, commas, 12 vs. 24h hour time):
>
> Thursday, August 4, 2016 at 12:50:43 AM CEST
> vs:
> Thu Aug 4 00:52:29 CEST 2016
>
one of those is a bug. the formats are defined in posix I believe.

Mark Martinec

no leída,
4 ago 2016, 5:44:41 p.m.4/8/16
para
Should I open a bug report, or has the problem been noted?

Mark

Julian Elischer

no leída,
5 ago 2016, 1:01:00 a.m.5/8/16
para
On 5/08/2016 5:44 AM, Mark Martinec wrote:
> Should I open a bug report, or has the problem been noted?
it's not clear without reading the standard whether the bug is in the
old or new version.
have you tried other systems? In particular I'd check OSX

sh-3.2$ export LC_CTYPE="en_US.UTF-8"
sh-3.2$ export LC_TIME="en_US.UTF-8"
sh-3.2$ export LC_ALL="en_US.UTF-8"
sh-3.2$ export LC_NUMERIC="en_US.UTF-8"
sh-3.2$ date
Fri Aug 5 12:57:47 AWST 2016

if it IS a bug then yes, file a report with full reproduction steps.

>
> Mark
>
>
> On 2016-08-04 04:32, Julian Elischer wrote:
>> On 4/08/2016 7:24 AM, Mark Martinec wrote:
>>> Is it normal/expected/documented that the date(1) command in 11.0
>>> now produces a timestamp in substantially different format
>>> in an "en_US.UTF-8" locale (long names, commas, 12 vs. 24h hour
>>> time):
>>>
>>> Thursday, August 4, 2016 at 12:50:43 AM CEST
>>> vs:
>>> Thu Aug 4 00:52:29 CEST 2016
>>>
>> one of those is a bug. the formats are defined in posix I believe.
>>
>>>
>>> Setting LC_TIME does not help:
>>>

>>> $LC_TIME="C" date

Mark Martinec

no leída,
5 ago 2016, 10:47:50 a.m.5/8/16
para
On 2016-08-05 07:00, Julian Elischer wrote:
> On 5/08/2016 5:44 AM, Mark Martinec wrote:
>> Should I open a bug report, or has the problem been noted?
> it's not clear without reading the standard whether the bug is in the
> old or new version.
> have you tried other systems? In particular I'd check OSX


Did some research, opened a PR against 11.0-BETA3:

[Bug 211598]
date(1) default format in en_EN locale breaks compatibility with 10.3
and violates POSIX

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211598


Mark


On 2016-08-05 07:00, Julian Elischer wrote:
[...]


> sh-3.2$ export LC_CTYPE="en_US.UTF-8"
> sh-3.2$ export LC_TIME="en_US.UTF-8"
> sh-3.2$ export LC_ALL="en_US.UTF-8"
> sh-3.2$ export LC_NUMERIC="en_US.UTF-8"
> sh-3.2$ date
> Fri Aug 5 12:57:47 AWST 2016
>
> if it IS a bug then yes, file a report with full reproduction steps.

Andrey Chernov

no leída,
5 ago 2016, 11:23:51 a.m.5/8/16
para
On 05.08.2016 17:47, Mark Martinec wrote:
> [Bug 211598]
> date(1) default format in en_EN locale breaks compatibility with 10.3
> and violates POSIX
>
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211598

It breaks compatibility but not violates POSIX. POSIX care of only its
own POSIX (or C) locale.

Mark Martinec

no leída,
5 ago 2016, 11:45:30 a.m.5/8/16
para
On 2016-08-05 17:23, Andrey Chernov wrote:
> On 05.08.2016 17:47, Mark Martinec wrote:
>> [Bug 211598]
>> date(1) default format in en_EN locale breaks compatibility with
>> 10.3
>> and violates POSIX
>>
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211598
>
> It breaks compatibility but not violates POSIX. POSIX care of only its
> own POSIX (or C) locale.

POSIX does say that the default format should be the same
as with "+%a %b %e %H:%M:%S %Z %Y".
It also says that %a and %b are locale's abbreviated names.

It may not say what an abbreviated name really looks like
in a particular locale, but it does distinguish between
full and abbreviated names.

Mark

Andrey Chernov

no leída,
5 ago 2016, 12:03:26 p.m.5/8/16
para
On 05.08.2016 18:44, Mark Martinec wrote:
> On 2016-08-05 17:23, Andrey Chernov wrote:
>> On 05.08.2016 17:47, Mark Martinec wrote:
>>> [Bug 211598]
>>> date(1) default format in en_EN locale breaks compatibility with 10.3
>>> and violates POSIX
>>>
>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211598
>>
>> It breaks compatibility but not violates POSIX. POSIX care of only its
>> own POSIX (or C) locale.
>
> POSIX does say that the default format should be the same
> as with "+%a %b %e %H:%M:%S %Z %Y".
> It also says that %a and %b are locale's abbreviated names.

It is true for _POSIX_ locale only, as I already say. en_US.* is not
POSIX or C locale.

> It may not say what an abbreviated name really looks like
> in a particular locale, but it does distinguish between
> full and abbreviated names.

It says nothing about other locales. Current format comes from CLDR, ask
bapt@
0 mensajes nuevos