[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] Re: (rewritten) In directory pages, how to show file dates in a specific timezone?


Le 21/06/2018 à 20:31, Dedeco Balaco a écrit :


Em 14-06-2018 14:25, Yann Ylavic escreveu:
On Thu, Jun 14, 2018 at 12:08 AM, Dedeco Balaco
<dedeco.balaco@xxxxxxxxx.invalid> wrote:

Em 13-06-2018 17:29, Yann Ylavic escreveu:

The date format used by mod_autoindex is hardcoded, and does not
include the timezone (%z or %Z in strftime format).
I think a patch is needed to eventually configure it (e.g. another
IndexOptions keyword).


Being hardcoded is bad.

Not so until someone notices ;)

Should I consider this as a bug and report it?

I'd call it an improvement request, bugzilla can be used for that yes.


The thread in LinuxQuestions.org I pointed has a basic code that I can use
to make some PHP code to list what I need. If that is not the better
solution, at least for something temporary, please point.

Possibly the easiest/fastest solution, because (see below)...


Taking the code from Apache's mod_autoindex, fixing and running the new code for my user is something easy to do? Will it need to be installed by root?
Making it available for other users in the server is not needed, not
necessary.

This needs mod_autoindex to be recompiled and installed in the httpd
directory (with whatever rights that may require).
If you can't do this, the PHP solution might be what you need for now.


I will check that now.

I imagined if a "to my user only" solution was possible. Compiling should not be a problem, or hard at all; installing it in my user folder is natural; to test it should be a matter of Apache config of any directory I create for that, possibly with a different (possibly uncommon) setting. The last part is exactly where I would need some help.

Thank you for all details you commented, Yann. Each of them have added information for me. Thanks to others who also replied.

If you can try, I think that applying the following patch should work for you:

Index: modules/generators/mod_autoindex.c
===================================================================
--- modules/generators/mod_autoindex.c	(révision 1833939)
+++ modules/generators/mod_autoindex.c	(copie de travail)
@@ -608,6 +608,9 @@
     AP_INIT_TAKE1("IndexHeadInsert", ap_set_string_slot,
                   (void *)APR_OFFSETOF(autoindex_config_rec, head_insert),
                   DIR_CMD_PERMS, "String to insert in HTML HEAD section"),
+    AP_INIT_TAKE1("IndexDateFormat", ap_set_string_slot,
+ (void *)APR_OFFSETOF(autoindex_config_rec, datetime_format),
+                  DIR_CMD_PERMS, "Format sting to be used "),
     {NULL}
 };



Everything looks already in place to override the date format. I think that only defining a new IndexDateFormat directive in order to initialize the already available 'datetime_format' variable is enough.

If IndexDateFormat is not defined, the date format will still be "%Y-%m-%d %H:%M" or "%d-%b-%Y %H:%M" depending on the use or not of IndexOptions UseOldDateFormat.


If you can try and give a feedback, this could be added in a future release.

CJ


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx