| 81 | } |
| 82 | |
| 83 | std::string TimestampToString(time_t time) |
| 84 | { |
| 85 | if (time == INVALID_TIME_STAMP) |
| 86 | return std::string("INVALID_TIME_STAMP"); |
| 87 | |
| 88 | tm * t = gmtime(&time); |
| 89 | char buf[100]; |
| 90 | #ifdef OMIM_OS_WINDOWS |
| 91 | sprintf_s(buf, ARRAY_SIZE(buf), "%04d-%02d-%02dT%02d:%02d:%02dZ", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, |
| 92 | t->tm_hour, t->tm_min, t->tm_sec); |
| 93 | #else |
| 94 | ::snprintf(buf, ARRAY_SIZE(buf), "%04d-%02d-%02dT%02d:%02d:%02dZ", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, |
| 95 | t->tm_hour, t->tm_min, t->tm_sec); |
| 96 | #endif |
| 97 | |
| 98 | return buf; |
| 99 | } |
| 100 | |
| 101 | std::string SecondsSinceEpochToString(uint64_t secondsSinceEpoch) |
| 102 | { |
no outgoing calls