留言板
Timezones available
In the visualization preferences for the portal, we have a combo list with a set of timezones that is not complete. For example America/Montevideo is nost available. The only GMT -3 is Brasil, but it has DST, so at this part of the year, i have a 1 hour shift.
We have read that we can add other timezones in portal-ext.properties (under the time.zones variable) but we had no luck. Is this OK? Is there any way to enhace that list with new timezones?
We are using Liferay 6.
Thanks in advance
Gustavo.-
We have read that we can add other timezones in portal-ext.properties (under the time.zones variable) but we had no luck. Is this OK? Is there any way to enhace that list with new timezones?
We are using Liferay 6.
Thanks in advance
Gustavo.-
Hi Gustavo --
6 -- as in 6.0? or 6.1? 6.2? .. CE? EE? if it is CE, which GA release. This is all important information for any reader that is hoping to try to reproduce what you are reporting.
6 -- as in 6.0? or 6.1? 6.2? .. CE? EE? if it is CE, which GA release. This is all important information for any reader that is hoping to try to reproduce what you are reporting.
Andrew, sorry for the lack of information.
I'm talking about Liferay 6.1.1 CE GA.
Thanks in advance
Gustavo.
I'm talking about Liferay 6.1.1 CE GA.
Thanks in advance
Gustavo.
6.1.1 GA is pretty old. You should be at least on 6.1.2 GA3 as it has some number of bugfixes over the original GA.
Hi Gustavo,
Sorry for the delay -- but I think I've got something for you. I''ve used the time.zones line from your configuration file in a fresh 6.1.1 GA2 bundle on my side. When i started the portal and went to Portal Settings I was confused by the labels as they did not align with what was configured. I traced the timze.zone property (using TIME_ZONE) in the portal source and found the ui taglib "input_time_zone". There I could see
So I felt validated that what I set in the String was being loaded. I followed the trail into the TimeZone util, which is a Liferay class, and then that took me into
.. and TimeZone is a java core class from the java.util package. In there I found this --
.. the interesting parameter is the fallback. My understanding is that if it doesn't find a match for the timezone you specify, it just uses some "equivalent" value if it can find one. I set my portal to use just time.zone=America/Toronto and when I restarted it showed me America/New York (we're in the same time zone) as the option. When I used just your Custom/GMT-3, I got UTC Greenwich Meantime -- but that isn't -3!
I next searched for the java class code on google. I'm not sure which version of the JVM you are using, so I am referencing 7 here -- but either way, note that I am now outside Liferay: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html
If you read the documentation at the top it talks about valid timezones and what you can use etc. I tried a few variations on Custom/GMT-3, but with no luck. In my searching though, interestingly, I found that GMT-3 is also know as "Papa" time in the military . Anyway, as a last ditch effort I decided to try JUST them timezone -- so I set this
... restarted the portal and then found in my Portal Settings > Display Settings a single value in the drop down -- (UTC-03:00) GMT-03:00. It's not pretty, but it looks like it has the timezone you are after.
HTH
Sorry for the delay -- but I think I've got something for you. I''ve used the time.zones line from your configuration file in a fresh 6.1.1 GA2 bundle on my side. When i started the portal and went to Portal Settings I was confused by the labels as they did not align with what was configured. I traced the timze.zone property (using TIME_ZONE) in the portal source and found the ui taglib "input_time_zone". There I could see
String[] timeZones = PropsUtil.getArray(PropsKeys.TIME_ZONES);
...
<%
for (int i = 0; i < timeZones.length; i++) {
TimeZone curTimeZone = TimeZoneUtil.getTimeZone(timeZones[i]);
...
So I felt validated that what I set in the String was being loaded. I followed the trail into the TimeZone util, which is a Liferay class, and then that took me into
private TimeZone _getTimeZone(String timeZoneId) {
TimeZone timeZone = _timeZones.get(timeZoneId);
if (timeZone == null) {
timeZone = TimeZone.getTimeZone(timeZoneId);
_timeZones.put(timeZoneId, timeZone);
}
return timeZone;
}
.. and TimeZone is a java core class from the java.util package. In there I found this --
private static TimeZone getTimeZone(String ID, boolean fallback) {
TimeZone tz = ZoneInfo.getTimeZone(ID);
if (tz == null) {
tz = parseCustomTimeZone(ID);
if (tz == null && fallback) {
tz = new ZoneInfo(GMT_ID, 0);
}
}
return tz;
}
.. the interesting parameter is the fallback. My understanding is that if it doesn't find a match for the timezone you specify, it just uses some "equivalent" value if it can find one. I set my portal to use just time.zone=America/Toronto and when I restarted it showed me America/New York (we're in the same time zone) as the option. When I used just your Custom/GMT-3, I got UTC Greenwich Meantime -- but that isn't -3!
I next searched for the java class code on google. I'm not sure which version of the JVM you are using, so I am referencing 7 here -- but either way, note that I am now outside Liferay: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html
If you read the documentation at the top it talks about valid timezones and what you can use etc. I tried a few variations on Custom/GMT-3, but with no luck. In my searching though, interestingly, I found that GMT-3 is also know as "Papa" time in the military . Anyway, as a last ditch effort I decided to try JUST them timezone -- so I set this
time.zones=GMT-03:00
... restarted the portal and then found in my Portal Settings > Display Settings a single value in the drop down -- (UTC-03:00) GMT-03:00. It's not pretty, but it looks like it has the timezone you are after.
HTH
Link to the site with the names the military uses for time zones incase anyone is curious: https://www.timeanddate.com/worldclock/timezone/utc-3. Apparently, I am in "Romeo" -- not sure my wife would agree ;)
Andrew Jardine:
Link to the site with the names the military uses for time zones incase anyone is curious: https://www.timeanddate.com/worldclock/timezone/utc-3. Apparently, I am in "Romeo" -- not sure my wife would agree ;)
Would Juliet have survived had Romeo and their Friar observed Daylight Savings Time ?