Merge branch 'localefix'
This commit is contained in:
commit
9a189be740
1 changed files with 4 additions and 1 deletions
5
rpc.cpp
5
rpc.cpp
|
@ -1498,7 +1498,10 @@ string rfc1123Time()
|
||||||
time_t now;
|
time_t now;
|
||||||
time(&now);
|
time(&now);
|
||||||
struct tm* now_gmt = gmtime(&now);
|
struct tm* now_gmt = gmtime(&now);
|
||||||
strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S %Z", now_gmt);
|
string locale(setlocale(LC_TIME, NULL));
|
||||||
|
setlocale(LC_TIME, "C"); // we want posix (aka "C") weekday/month strings
|
||||||
|
strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt);
|
||||||
|
setlocale(LC_TIME, locale.c_str());
|
||||||
return string(buffer);
|
return string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue