Clock Plugin: Ability to select time zones (Espically UTC) #427

Closed
kenfallon opened this Issue Oct 2, 2012 · 8 comments

Comments

Projects
None yet
4 participants

It is possible to add multiple clocks so it would make sense to be able to select different time zones for the clocks as well. I find it very useful to have local time and UTC displayed.

Owner

jleclanche commented Oct 2, 2012

+1

In the Time section of the clock settings, a radio button should be added:

  • Use system time zone
  • Always display for [dropdown]

https://qt-project.org/doc/qt-4.8/qdatetime.html#currentDateTimeUtc supports utc but time zone information is not supported

Member

kuzmas commented Oct 6, 2012

I've looked at it and found that setting environment variable TZ changes timezone for QDateTime. The question is how to isolate these changes and make the effect per plugin, since environment variable affects the whole application.
One of solutions is to fork and use a pipe between apps or just use a small external app, but personally I think it's to complicated for such a simple thing. So, I'll investigate it a little bit more and let you know the result. And of course if the result is positive - I'll implement it.

Member

kuzmas commented Oct 19, 2012

It definitely requires a separate process. Because of this restriction, an embedded calendar can only show date based on a local timezone. So I think it can be weird if plugin itself shows one date as today, but popup calendar shows another one.

What if plugin will show additional timezones only in tooltip? Is it OK?

P.S. As to UTC, I've made already a patch with UTC support as part of pull request: #445

My use case it that I want local time and the UTC only so I can track logfiles in the servers and also track lunch time. So your patch to UTC is great for me.

I can imagine that people would like to add a clock for local time, another for time at Corporate HQ and another where your better half is currently located.

Member

kuzmas commented Oct 20, 2012

Ok, so I see I'm the only one left who needs clock with multiple time
zones then... In this case I'll implement it the way I want. Yesterday
I found that there are two ways to generate time for any time zone
within the one process (but they are both not based on Qt):

  1. Boost - but its timezone DB is incomplete
  2. ICU - very good, with good timezone DB, localized to many languages.

I'm going to create a new panel plugin based on the ICU library. Any
objections, main developers?

Member

amoskvin commented Oct 23, 2012

On Saturday 20 October 2012 13:59:53, Kuzma Shapran wrote:

Ok, so I see I'm the only one left who needs clock with multiple time
zones then... In this case I'll implement it the way I want. Yesterday
I found that there are two ways to generate time for any time zone
within the one process (but they are both not based on Qt):

  1. Boost - but its timezone DB is incomplete
  2. ICU - very good, with good timezone DB, localized to many languages.

I'm going to create a new panel plugin based on the ICU library. Any
objections, main developers?

Ideally, I think it would be best to have it all in one plugin, but
since it's adding a large dependency, it would probably need to be
optional. And since making it optional will probably be a pain, I guess
making it a separate plugin would be a good approach. Hopefully there
won't be too much code duplication.

And by the way, being able to see time in different timezones is
definitely something we need, especially around release time :)

kuzmas closed this Jan 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment