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 @@ -309,10 +309,10 @@ namespace data
struct tm tm;
#ifdef _WIN32
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
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
IdentHash key;
CryptoPP::SHA256().CalculateDigest((uint8_t *)key, buf, 40);

Loading…
Cancel
Save