fancyindex_localtime

The `fancyindex_localtime` directive configures the NGINX Fancy Index module to display file modification times in the local timezone.

Syntaxfancyindex_localtime on | off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

The fancyindex_localtime directive is used within the contexts of http, server, and location to toggle whether the directory listing's modification times will reflect the server's local timezone rather than UTC. By default, the NGINX Fancy Index module displays timestamps in UTC, which can lead to confusion for users in different time zones. Enabling this directive ensures that modification timestamps are shown in a way that is more relevant for local users, effectively enhancing user experience especially when files are accessed in different geographical regions.

When setting this directive, it only accepts a flag indicating whether to enable or disable the local time representation. This makes it simple and straightforward to implement. Users can gain an immediate understanding of when files were last modified in their local time, which is particularly useful for sites serving content to a localized audience. It also works in conjunction with any timezone configurations made in the system, ensuring consistency and accuracy in time representations across the server and user experience.

Config Example

http {
    server {
        location /files {
            fancyindex on;
            fancyindex_localtime on;
        }
    }
}

Ensure that the server's local timezone is correctly configured; otherwise, the displayed times may be inaccurate.

Remember that local time representation will not be helpful if your audience is spread across multiple time zones.

← Back to all directives