Commit 0a9b0dd0 authored by Max Kellermann's avatar Max Kellermann

command: fallback strftime() formats on WIN32

On WIN32, "%F" and "%T" are not implemented.
parent 6aa0f61e
...@@ -387,10 +387,12 @@ print_spl_list(struct client *client, GPtrArray *list) ...@@ -387,10 +387,12 @@ print_spl_list(struct client *client, GPtrArray *list)
client_printf(client, "playlist: %s\n", playlist->name); client_printf(client, "playlist: %s\n", playlist->name);
t = playlist->mtime; t = playlist->mtime;
strftime(timestamp, sizeof(timestamp), "%FT%TZ", strftime(timestamp, sizeof(timestamp),
#ifdef WIN32 #ifdef G_OS_WIN32
"%Y-%m-%dT%H:%M:%SZ",
gmtime(&t) gmtime(&t)
#else #else
"%FT%TZ",
gmtime_r(&t, &tm) gmtime_r(&t, &tm)
#endif #endif
); );
......
...@@ -79,7 +79,13 @@ song_print_info(struct client *client, struct song *song) ...@@ -79,7 +79,13 @@ song_print_info(struct client *client, struct song *song)
if (tm2 != NULL) { if (tm2 != NULL) {
char timestamp[32]; char timestamp[32];
strftime(timestamp, sizeof(timestamp), "%FT%TZ", tm2); strftime(timestamp, sizeof(timestamp),
#ifdef G_OS_WIN32
"%Y-%m-%dT%H:%M:%SZ",
#else
"%FT%TZ",
#endif
tm2);
client_printf(client, "Last-Modified: %s\n", client_printf(client, "Last-Modified: %s\n",
timestamp); timestamp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment