Browse Source

proper date formatting

pull/102/head
orignal 10 years ago
parent
commit
03914b4f41
  1. 4
      Identity.cpp

4
Identity.cpp

@ -309,10 +309,10 @@ namespace data
struct tm tm; struct tm tm;
#ifdef _WIN32 #ifdef _WIN32
gmtime_s(&tm, &t); gmtime_s(&tm, &t);
sprintf_s((char *)(buf + 32), 9, "%4i%2i%2i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); sprintf_s((char *)(buf + 32), 9, "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
#else #else
gmtime_r(&t, &tm); gmtime_r(&t, &tm);
sprintf((char *)(buf + 32), "%4i%2i%2i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); sprintf((char *)(buf + 32), "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
#endif #endif
IdentHash key; IdentHash key;
CryptoPP::SHA256().CalculateDigest((uint8_t *)key, buf, 40); CryptoPP::SHA256().CalculateDigest((uint8_t *)key, buf, 40);

Loading…
Cancel
Save