#34387: DateFormat.P() does not follow PHP's date string format
--------------------------------------+------------------------
Reporter: nullwaves | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
--------------------------------------+------------------------
PHP's documentation defines the P character as follows:
"P Difference to Greenwich time (GMT) with colon between hours and
minutes Example: +02:00"
However in django, P() appears to be implemented as
"Time, in 12-hour hours, minutes and 'a.m.'/'p.m.', with minutes left off
if they're zero and the strings 'midnight' and 'noon' if
appropriate.
Examples: '1 a.m.', '1:30 p.m.', 'midnight', 'noon', '12:30 p.m.'
Proprietary extension."
For example:
{{{
DateFormat(self.created_on).format("F jS Y, h:ia P")
}}}
returns "March 5th 2023, 08:44a.m. 8:44 a.m." when it should return "March
5th 2023, 08:44a.m. -05:00"
--
Ticket URL: <https://code.djangoproject.com/ticket/34387>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070186b115c7c7-5119f3d2-58a5-4e55-bf6d-197c6f740e63-000000%40eu-central-1.amazonses.com.