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:
jackpoz
2019-04-19 23:45:07 +02:00
committed by Shauren
parent aeaca00d76
commit 5600316c9f
3 changed files with 17 additions and 0 deletions

View File

@@ -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;