#34241: Django admin not showing seconds for list_display nor readonly
DateTimeField
-------------------------------+--------------------------------------
Reporter: Petr DlouhĂ˝ | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => wontfix
Comment:
Replying to [ticket:34241 Petr DlouhĂ˝]:
> The default output format for DateTimeField (e.g. `created`) fields in
Django admin is something like `Jan. 4, 2023, 4:22 p.m.`. When I am
debugging some issue and trying to find matching record in logs I am
lacking information about second (or even milliseconds).
Thanks for the ticket, however I find it unusual to use the admin for
debugging, especially so precise that seconds/milliseconds are needed. I'd
recommend using the `dbshell`/`shell` console to search for specific
rows/objects.
> The only solutions I found is either to change `DATETIME_FORMAT`
systemwise:
> {{{
> from django.conf.locale.en import formats as en_formats
> en_formats.DATETIME_FORMAT = "d M. Y H:i:s"
> }}}
>
> or to change the output for individual fields.
>
> But I would like to see seconds for all DateTime fields in whole admin
interface and not to change the format in frontend nor API (which the
first solution causes).
>
> Most importantly I feel, that all Django users would benefit from
ability to access whole information about DateTime which is stored in the
database. So my suggestion is to start outputting DateTime fields in admin
interface with tooltip containing whole precise time such as:
> {{{
> <div class="readonly" title="Jan. 4, 2023, 4:22:30.123 p.m.">Jan. 4,
2023, 4:22 p.m.</div>
> }}}
IMO, debugging with the admin doesn't justify pushing extra data to the UI
that are not needed and not used otherwise. You can start a discussion on
DevelopersMailingList if you don't agree.
--
Ticket URL: <https://code.djangoproject.com/ticket/34241#comment:1>
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/01070185858a9c5d-8f132854-acbe-4a8d-adab-538a9e68b4dc-000000%40eu-central-1.amazonses.com.