fancyindex_time_format

The `fancyindex_time_format` directive specifies the format for displaying the last modification time of files in directory listings.

Syntaxfancyindex_time_format format;
Defaultnone
Contexthttp, server, location
Argumentsflag

Description

The fancyindex_time_format directive is used within the NGINX Fancy Index module to control how the modification times of files are formatted when displayed in directory listings. This directive allows users to customize the format in which the timestamps appear, providing flexibility in displaying dates. The format employs directives similar to the strftime function used in standard C library, allowing a wide variety of options for structuring the date and time output.

You can specify various formats such as short (e.g., abbreviated weekday names, month names) or long (full names), as well as numerical representations of hours, minutes, and seconds. The directive can be set to a variety of string formats, which includes options like '%Y-%m-%d', '%H:%M', etc. By providing these formats, the directive enhances the readability of the modification timestamps, allowing for better presentation of file information in listings generated by the NGINX server.

In use, setting this directive affects all directory listings that rely on the Fancy Index module across specified contexts (http, server, location) within an NGINX configuration. This means if you define the format at a higher scope, all subsequent child contexts will inherit this format unless overridden by another fancyindex_time_format directive.

Config Example

location /downloads {
    fancyindex on;
    fancyindex_time_format "%Y-%m-%d %H:%M";
}

Ensure the format string is correctly defined using valid format specifiers; incorrect formats could result in unwanted output.

Be aware of time zone settings, as the displayed time will depend on the NGINX server's configured time zone settings.

← Back to all directives