php.net |  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
Votes:2
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 32 = ?
Subscribe to this entry?

 
 [2011-05-10 01:01 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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.

http://library.princeton.edu/departments/tsd/katmandu/reference/months.html
 [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 
issue.
 [2017-01-12 20:10 UTC] heiglandreas@php.net
-Status: Open +Status: Not a bug
 [2017-01-12 20:10 UTC] heiglandreas@php.net
To handle this issue have a look at the IntlDateFormatter.

Have a look at https://3v4l.org/8kveq for an example.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 07:01:30 2024 UTC