summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-14 00:46:28 +0200
committerwm4 <wm4@nowhere>2013-06-14 00:46:28 +0200
commit60a0c450eb8ce47193e5cf3b6c9ca282296720ca (patch)
tree051749fcea57578aae14aea3e480f463972ba0af /core
parent118a2a359f93d8fcd3fc2290162c45a0c17fc7a2 (diff)
downloadmpv-60a0c450eb8ce47193e5cf3b6c9ca282296720ca.tar.bz2
mpv-60a0c450eb8ce47193e5cf3b6c9ca282296720ca.tar.xz
command: use more standard time format for clock property
%k is not very standard. The manpage notes them as conforming to "Olson's timezone package", and it's not standard C89, C99 or POSIX. mingw doesn't provide it, and even some of the smaller Linux libcs don't have support. Use %H instead. This gives slightly different results, but I think this is ok. Difference in behavior between these summarized: %k: "single digits are preceded by a blank" %H: "range 00 to 23"
Diffstat (limited to 'core')
-rw-r--r--core/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/command.c b/core/command.c
index 8ba58867dd..4da0653425 100644
--- a/core/command.c
+++ b/core/command.c
@@ -629,7 +629,7 @@ static int mp_property_clock(m_option_t *prop, int action, void *arg,
time_t t = time(NULL);
struct tm *tmp = localtime(&t);
- if ((tmp != NULL) && (strftime(outstr, sizeof(outstr), "%k:%M", tmp) == 5))
+ if ((tmp != NULL) && (strftime(outstr, sizeof(outstr), "%H:%M", tmp) == 5))
return m_property_strdup_ro(prop, action, arg, outstr);
return M_PROPERTY_UNAVAILABLE;
}