mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
Merge pull request #1713 from behnejad/master
display file modify date in "%Y/%m/%d %H:%M:%S".
This commit is contained in:
commit
50a2063e45
12
src/http.c
12
src/http.c
@ -563,7 +563,19 @@ static void printdirentry(const char *name, void *userdata) {
|
||||
} else {
|
||||
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
||||
}
|
||||
#if defined(MG_HTTP_DIRLIST_TIME)
|
||||
char time_str[30];
|
||||
struct tm * time_info = localtime(&t);
|
||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
||||
char time_str[30];
|
||||
struct tm * time_info = gmtime(&t);
|
||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||
#else
|
||||
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
||||
#endif
|
||||
n = (int) mg_url_encode(name, strlen(name), path, sizeof(path));
|
||||
mg_printf(d->c,
|
||||
" <tr><td><a href=\"%.*s%s\">%s%s</a></td>"
|
||||
|
Loading…
x
Reference in New Issue
Block a user