lavf: factor out conversion of ISO8601 string to unix time

This commit is contained in:
Anton Khirnov
2011-07-13 11:45:17 +02:00
parent b21e6b707f
commit 001d668d40
6 changed files with 20 additions and 21 deletions

View File

@@ -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);
}