Use the local timezone when localizing UTC timestamps. Patch by Imarok, fixes #3350, refs #2938.

Thus show the correct time in the lobby, savegame and replay menu.

This was SVN commit r18725.
This commit is contained in:
elexis 2016-09-15 13:16:48 +00:00
parent 5d3f1ce348
commit c92e74138a
3 changed files with 4 additions and 4 deletions

View File

@ -387,7 +387,7 @@ std::string L10n::FormatMillisecondsIntoDateString(const UDate& milliseconds, co
if (U_FAILURE(status))
LOGERROR("Error creating SimpleDateFormat: %s", u_errorName(status));
const TimeZone* timeZone = TimeZone::getGMT();
const TimeZone* timeZone = TimeZone::createDefault();
status = U_ZERO_ERROR;
Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status);

View File

@ -427,7 +427,7 @@ public:
std::string LocalizeDateTime(const UDate& dateTime, const DateTimeType& type, const DateFormat::EStyle& style) const;
/**
* Returns the specified date using the specified date format.
* Returns the specified date converted to the local timezone using the specified date format.
*
* @param milliseconds Date specified as a UNIX timestamp in milliseconds
* (not seconds).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2016 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -153,7 +153,7 @@ namespace JSI_L10n
std::vector<std::wstring> TranslateArray(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::vector<std::wstring>& sourceArray);
/**
* Returns the specified date using the specified date format.
* Returns the specified date converted to the local timezone using the specified date format.
*
* This is a JavaScript interface to
* L10n::FormatMillisecondsIntoDateString().