mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Calendar: Improve calendar timezone handling
Improve calendar timezone handling by at least creating events with the correct time if both client and server are in the same timezone. There is currently no information received from the client about in which timezone it is.
(cherry picked from commit b33934f6ce)
This commit is contained in:
@@ -77,6 +77,15 @@ struct tm* localtime_r(time_t const* time, struct tm *result)
|
||||
}
|
||||
#endif
|
||||
|
||||
time_t LocalTimeToUTCTime(time_t time)
|
||||
{
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||
return time + _timezone;
|
||||
#else
|
||||
return time + timezone;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
|
||||
{
|
||||
uint64 secs = timeInSecs % MINUTE;
|
||||
|
||||
Reference in New Issue
Block a user