Req #54699 [Opn->Nab]: Abbreviated month comes out wrong.
| From: | heiglandreas@php.net | Date: | Thu, 12 Jan 2017 20:10:26 +0000 |
| Subject: | Req #54699 [Opn->Nab]: Abbreviated month comes out wrong. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206579@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54699&edit=1
ID: 54699
Updated by: heiglandreas@php.net
Reported by: info at swedishboy dot se
Summary: Abbreviated month comes out wrong.
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Date/time related
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
To handle this issue have a look at the IntlDateFormatter.
Have a look at https://3v4l.org/8kveq for an example.
Previous Comments:
------------------------------------------------------------------------
[2013-03-01 19:57:55] jellofishi at gmail dot com
PHP uses the system's libc implementation of srtftime. This is not a PHP specific
issue.
------------------------------------------------------------------------
[2011-05-10 01:11:13] info at swedishboy dot se
Seems like there are more languages that should use different abbreviations
depending on the full name.
http://library.princeton.edu/departments/tsd/katmandu/reference/months.html
------------------------------------------------------------------------
[2011-05-10 01:09:02] info at swedishboy dot se
Actually my point is that even in English May, June and July shouldn't be
shortened. I believe this is actually the typograhic rule. Am I wrong?
Maybe use one of the abbreviations for month to follow typographic rules?
------------------------------------------------------------------------
[2011-05-10 01:01:51] info at swedishboy dot se
Description:
------------
Abbreviated month always displays month names with three letters.
However ... in Swedish we never write July and June with three letters.
This is seen as wrong and not the standard way of shortening the month names.
The reason is simple. July (juli in swedish) when shortening to three letter
becomes 'Jul' which is the swedish word for christmas.
I realized how stupid and funny it looks when I programmed a calendar plugin for
wordpress and I echoed some dates in July.
So both July and June should spell out juli and juni when set_locale is set to
Swedish language.
One more detail; Month names should are written in lowercase in Swedish when
used in sentences. This can of course simply be controlled by the programmer
using strtolower() and should be the prefered solution I'd say.
Test script:
---------------
<?php
setlocale(LC_ALL, 'sv_SE');
echo strftime('%d %b %Y', strtotime("2 July 2011"));
?>
Expected result:
----------------
2 Juli 2011
Actual result:
--------------
2 Jul 2011
(Jul = Christmas in swedish)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54699&edit=1