|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54699 Abbreviated month comes out wrong.
Submitted: 2011-05-10 01:01 UTC Modified: 2017-01-12 20:10 UTC
Avg. Score:2.0 ± 1.0
Reproduced:0 of 0 (0.0%)
From: info at swedishboy dot se Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2011-05-10 01:01 UTC] info at swedishboy dot se
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:

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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-10 01:09 UTC] 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:11 UTC] info at swedishboy dot se
Seems like there are more languages that should use different abbreviations 
depending on the full name.
 [2013-03-01 19:57 UTC] jellofishi at gmail dot com
PHP uses the system's libc implementation of srtftime. This is not a PHP specific 
 [2017-01-12 20:10 UTC]
-Status: Open +Status: Not a bug
 [2017-01-12 20:10 UTC]
To handle this issue have a look at the IntlDateFormatter.

Have a look at for an example.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 01:01:31 2024 UTC