Since this inc has ~1000 downloads, here are my 2 cents:
1. TZ offset calc in GetTimeZone() is wrong:
PHP Code:
// FormatTime( szTime, sizeof( szTime ), "%m~%d~%y~%H~%M~%S", GetTime( ) ); // 24 -> 2024
FormatTime( szTime, sizeof( szTime ), "%m~%d~%Y~%H~%M~%S", GetTime( ) );
// char szTimeParts[ 6 ][ 4 ]; // https://github.com/alliedmodders/sourcepawn/blob/96ce3259003c8fe77cf9f1a0f84bbb3167b81b5d/vm/plugin-context.cpp#L346
char szTimeParts[ 6 ][ 5 ];
&&
2. imagine local_unix->local_datetime->(change hour?)->local_unix, in TimeToUnix( using UT_TIMEZONE_SERVER ) there should be -, not + (double check my logic, timezones = minefield)
PHP Code:
// return ( iTimeStamp + g_iTimeZoneOffset[ iTimeZone ] );
return ( iTimeStamp - g_iTimeZoneOffset[ iTimeZone ] );
Fixed inc: