1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add utc time format.

This commit is contained in:
winlin 2015-04-03 16:42:32 +08:00
parent 56cd373015
commit e458305f81
8 changed files with 73 additions and 20 deletions

View file

@ -274,8 +274,14 @@ bool SrsFastLog::generate_header(bool error, const char* tag, int context_id, co
// to calendar time
struct tm* tm;
if ((tm = localtime(&tv.tv_sec)) == NULL) {
return false;
if (_srs_config->get_utc_time()) {
if ((tm = gmtime(&tv.tv_sec)) == NULL) {
return false;
}
} else {
if ((tm = localtime(&tv.tv_sec)) == NULL) {
return false;
}
}
// write log header