Outputs a GMT time string for the given epoch seconds, which looks like 2013-04-28 20:57:01.000 +0000
| 1920 | // Outputs a GMT time string for the given epoch seconds, which looks like |
| 1921 | // 2013-04-28 20:57:01.000 +0000 |
| 1922 | std::string epochsToGMTString(double epochs) { |
| 1923 | auto time = (time_t)epochs; |
| 1924 | |
| 1925 | char buff[50]; |
| 1926 | auto size = strftime(buff, 50, "%Y-%m-%d %H:%M:%S", gmtime(&time)); |
| 1927 | std::string timeString = std::string(std::begin(buff), std::begin(buff) + size); |
| 1928 | |
| 1929 | // Add fractional seconds and GMT timezone. |
| 1930 | double integerPart; |
| 1931 | timeString += format(".%03.3d +0000", (int)(1000 * modf(epochs, &integerPart))); |
| 1932 | |
| 1933 | return timeString; |
| 1934 | } |
| 1935 | |
| 1936 | void setMemoryQuota(size_t limit) { |
| 1937 | if (limit == 0) { |