Is there a simple way to change timezone shift values for the system? My customer wants to see Moscow time as +0, but not as +3 GMT. Corresponding timezone shifts should be recounted respectively, so we should see [+/-]<...> Moscow Time. There is no strict demands about whether it should be only displayed timeshift, or persistent. I thought about using a custom datatype, but stuck on inventing an algorithm of recounting timezone, so I’m asking you here for some help or giving me a direction - where to search for a solution. Thanks in advance.
P.S. Not to say it’s extremely exotic request, because as we install any Debian-like OS, it always shows current user timezone as +0 (swtchable to GMT, UTC, CET and others)
Can you, please, provide some more information about the way of doing this? where to create my new implementation (my guess is package com.company.app.core) and how to register it, will this (spring.xml<bean name="cuba_TimeZones" class="com.company.app.core.CustomTimeZones" />) be enough? do i need to implement all methods of the overridden bean, or can i simply extend it?
Thanks for your answer, but not in web module. In core module. It took some time and a ClassNotFoundException to figure it out. Anyway, i’m doing something wrong: i extend the TimeZones, add any string to returned String of getDisplayOffset(TimeZone);, like return super.getDizplayOffset(timeZone) + "test"; and see nothing happen in my application, it shows my timezone as MSK (GMT+03:00)
TimeZones bean is defined in cuba-global module. This means that it is instantiated twice: one instance in core module, another - in web module.
But all usages of TimeZones in CUBA code are located in gui and web modules, so it is OK to forget about core module.
So you need to create extended bean in web module, and register it in the web module’s spring.xml.