django (version 3.1):
{{{#!python
>>> import datetime
>>> from django.utils import dateformat
>>> dateformat.format(datetime.datetime(123, 4, 5, 6, 7), "y")
'3'
}}}
python (version 3.8):
{{{#!python
>>> import datetime
>>> datetime.datetime(123, 4, 5, 6, 7).strftime("%y")
'23'
}}}
php (version 7.4):
{{{#!php
echo date("y", strtotime("0123-04-05 06:07:00"))
23
}}}
I have a pull-request ready for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/32149>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Sam
* needs_docs: 0 => 1
* status: new => assigned
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32149#comment:1>
* needs_docs: 1 => 0
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
Comment:
[https://github.com/django/django/pull/13670 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32149#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"895f6e49925ed0ae4bb96dc4d3af17fdc9c4846e" 895f6e49]:
{{{
#!CommitTicketReference repository=""
revision="895f6e49925ed0ae4bb96dc4d3af17fdc9c4846e"
Fixed #32149 -- Added support for years < 1000 to DateFormat.y().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32149#comment:5>