aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-13 11:45:17 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-13 12:14:25 +0200
commit001d668d40b5f87d19271c7d5521368b5187425b (patch)
tree0812bd4345eff2b6aa09a664064c4cc643d69321 /libavformat/utils.c
parentb21e6b707fbc80511f4886d3b272a77b86157a2d (diff)
downloadffmpeg-001d668d40b5f87d19271c7d5521368b5187425b.tar.gz
lavf: factor out conversion of ISO8601 string to unix time
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index bbd1b2d07b..bb12e24d8c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3884,3 +3884,10 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
}
av_strlcat(buf, rel, size);
}
+
+int64_t ff_iso8601_to_unix_time(const char *datestr)
+{
+ struct tm time = {0};
+ strptime(datestr, "%Y - %m - %dT%T", &time);
+ return mktime(&time);
+}