// Returns the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
// This function exists only as a replacement for strftime(false, "%s") which doesn't work
-// on Windows (%s is not supported)
+// on Windows (%s is not supported) and at least in some linux systems doesn't return the
+// correct result
// NOTE: at the current date, the number (string) returned by both strftime(false, "%s") and
// strftime_s() is so high that can't be converted to int (with ftos) without precision loss
ERASEABLE
this.autoscreenshot = -1;
if(IS_REAL_CLIENT(this))
{
- string num = strftime(false, "%s");
- if (num == "")
- num = strftime_s();
+ string num = strftime_s(); // strftime(false, "%s") isn't reliable, see strftime_s description
stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; "
"echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), num));
}
// character set: ASCII 33-126 without the following characters: : ; ' " \ $
if(autocvar_sv_eventlog)
{
- string num = strftime(false, "%s");
- if (num == "")
- num = strftime_s();
+ string num = strftime_s(); // strftime(false, "%s") isn't reliable, see strftime_s description
string s = sprintf("%s.%s.%06d", itos(autocvar_sv_eventlog_files_counter), num, floor(random() * 1000000));
matchid = strzone(s);