aboutsummaryrefslogtreecommitdiff
path: root/rpc.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-04-15 12:03:50 -0400
committerGavin Andresen <[email protected]>2011-04-15 12:03:50 -0400
commit9a189be7401c583fd74fc7f3d7812327323ceecb (patch)
treebeadfb185d9a8ed9d17a5f1f6636981257db33cb /rpc.cpp
parentMerge branch 'http-version' of https://github.com/jgarzik/bitcoin (diff)
parentSet time locale to POSIX in rfc1123Time so weekday/months in http responses a... (diff)
downloaddiscoin-9a189be7401c583fd74fc7f3d7812327323ceecb.tar.xz
discoin-9a189be7401c583fd74fc7f3d7812327323ceecb.zip
Merge branch 'localefix'
Diffstat (limited to 'rpc.cpp')
-rw-r--r--rpc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc.cpp b/rpc.cpp
index 257065583..0866bb50e 100644
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -1498,7 +1498,10 @@ string rfc1123Time()
time_t now;
time(&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);
}