Timezone question in configuration wizard

26 views
Skip to first unread message

Karl Heinz

unread,
Apr 19, 2014, 10:34:28 AM4/19/14
to nikola-...@googlegroups.com
Hello,

First of all: Thanks for the great application! Nikola is really really nice!

I have one small suggestion:

In Nikola 7 thankfully there are many configuration questions when creating a new blog with init.I think asking about the timezone would be really nice as well. Currently, just setting UTC for every blog is not quite good. Only few people live in UTC (and that only during winter), so almost everyone needs to change the timezone either way. But the configuration is so deeply buried in the conf.py file that I wondered (still with version 6.4) why all my posts are in the future and were not correctly generated.

So I think it is better if the TIMEZONE variable is at the beginning of conf.py, and if the configuration wizard explicitely ask for it. Maybe it is also possible to already make some guesses for the timezone based on the primary language. Many languages are only/mostly spoken in one timezone (German, Japanese, Chinese), making the configuration a little bit easier.

What do you think about this?

Thanks!

Roberto Alsina

unread,
Apr 19, 2014, 10:41:29 AM4/19/14
to nikola-...@googlegroups.com
Good point about the config file. Done :-)


I'll leave the extra question on Kwpolska's plate.



--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris “Kwpolska” Warrick

unread,
Apr 19, 2014, 11:23:51 AM4/19/14
to Nikola—Discuss
On Sat, Apr 19, 2014 at 4:34 PM, Karl Heinz <kh3...@gmail.com> wrote:
> In Nikola 7 thankfully there are many configuration questions when creating
> a new blog with init.I think asking about the timezone would be really nice
> as well. Currently, just setting UTC for every blog is not quite good. Only
> few people live in UTC (and that only during winter),

There are people who live in UTC all year round, or during the summer, too!

http://en.wikipedia.org/wiki/UTC%C2%B100:00

> so almost everyone needs to change the timezone either way.

That "UTC" setting is there as a good-enough default.

> But the configuration is so deeply
> buried in the conf.py file that I wondered (still with version 6.4) why all
> my posts are in the future and were not correctly generated.

Please don’t jump from version to version.

> So I think it is better if the TIMEZONE variable is at the beginning of
> conf.py, and if the configuration wizard explicitely ask for it.

Will implement this soon — possibly even today.

> Maybe it is
> also possible to already make some guesses for the timezone based on the
> primary language. Many languages are only/mostly spoken in one timezone
> (German, Japanese, Chinese), making the configuration a little bit easier.

Not quite.

German is spoken in five timezones:

1. Europe/Berlin
2. Europe/Vienna
3. Europe/Zurich
4. Europe/Vaduz
5. Europe/Busingen (Büsingen am Hochrhein — small German exclave in Switzerland)

Chinese is spoken in eight timezones:

1. Asia/Shanghai
2. Asia/Harbin
3. Asia/Chongqing
4. Asia/Urumqi
5. Asia/Kashgar
6. Asia/Hong_Kong
7. Asia/Macau
8. Asia/Taipei

(src: http://en.wikipedia.org/wiki/China_Standard_Time#IANA_time_zone_database )

And no, it doesn’t matter at all that today all of those time zones
have the same value. Someone from AT may be angry that we believed he
is in DE. And you really don’t want to get into such conflicts with
people speaking Chinese.

Moreover, you are free to write a blog in any language everywhere.
Guessing time zones based on languages may be problematic to such
people — it’s easier to just ask the user.

--
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense

Chris “Kwpolska” Warrick

unread,
Apr 19, 2014, 11:56:08 AM4/19/14
to Nikola—Discuss
On Sat, Apr 19, 2014 at 5:23 PM, Chris “Kwpolska” Warrick
<kwpo...@gmail.com> wrote:
> On Sat, Apr 19, 2014 at 4:34 PM, Karl Heinz <kh3...@gmail.com> wrote:
>> So I think it is better if the TIMEZONE variable is at the beginning of
>> conf.py, and if the configuration wizard explicitely ask for it.
>
> Will implement this soon — possibly even today.

Done on master as
https://github.com/getnikola/nikola/commit/c6d9ca8ca9e9bbdb8abf1f99011081b9c7f2f16d

Roberto Alsina

unread,
Apr 19, 2014, 12:35:00 PM4/19/14
to nikola-...@googlegroups.com
On 19/04/14 12:23, Chris “Kwpolska” Warrick wrote:
> On Sat, Apr 19, 2014 at 4:34 PM, Karl Heinz <kh3...@gmail.com> wrote:
>> In Nikola 7 thankfully there are many configuration questions when creating
>> a new blog with init.I think asking about the timezone would be really nice
>> as well. Currently, just setting UTC for every blog is not quite good. Only
>> few people live in UTC (and that only during winter),
> There are people who live in UTC all year round, or during the summer, too!
>
> http://en.wikipedia.org/wiki/UTC%C2%B100:00
>
>> so almost everyone needs to change the timezone either way.
> That "UTC" setting is there as a good-enough default.
>
>> But the configuration is so deeply
>> buried in the conf.py file that I wondered (still with version 6.4) why all
>> my posts are in the future and were not correctly generated.
> Please don’t jump from version to version.
>
>> So I think it is better if the TIMEZONE variable is at the beginning of
>> conf.py, and if the configuration wizard explicitely ask for it.
> Will implement this soon — possibly even today.
>
>> Maybe it is
>> also possible to already make some guesses for the timezone based on the
>> primary language. Many languages are only/mostly spoken in one timezone
>> (German, Japanese, Chinese), making the configuration a little bit easier.
> Not quite.

We *could* guess based on the system's TZ though:

https://labix.org/python-dateutil#head-5fb12f4538c5a2fd83f87eea8e6c0ddd47f8b4b0

Kay Hayen

unread,
Apr 20, 2014, 8:50:18 AM4/20/14
to nikola-...@googlegroups.com
Hello Chris,


2014-04-19 17:23 GMT+02:00 Chris “Kwpolska” Warrick <kwpo...@gmail.com>:
On Sat, Apr 19, 2014 at 4:34 PM, Karl Heinz <kh3...@gmail.com> wrote:
> In Nikola 7 thankfully there are many configuration questions when creating
> a new blog with init.I think asking about the timezone would be really nice
> as well. Currently, just setting UTC for every blog is not quite good. Only
> few people live in UTC (and that only during winter),

There are people who live in UTC all year round, or during the summer, too!

http://en.wikipedia.org/wiki/UTC%C2%B100:00

> so almost everyone needs to change the timezone either way.

That "UTC" setting is there as a good-enough default.


For a wizard, filling it in, probably the system timezone would be OK. I even contend
that users will only ever come to realize that timezones exist with Nikola, if you don't
do this.

For my buildbot, git push hook, etc. the use of a sane default is very nice. 

 
German is spoken in five timezones:

1. Europe/Berlin
2. Europe/Vienna
3. Europe/Zurich
4. Europe/Vaduz
5. Europe/Busingen (Büsingen am Hochrhein — small German exclave in Switzerland)


And no, it doesn’t matter at all that today all of those time zones
have the same value.  

Germany, Austria and Switzerland could any day make diverging decisions about say the summer
time rules, so indeed that matters. But the user already configured a preferred time zone on the
system, why not suggest to use that.

The other, and better idea for display, would be translate time stamps during rendering with a small
piece of JavaScript. That will make my "UTC" time stamps look good to whatever user is reading the
site.

What do you think Chris?

Yours,
Kay

Chris “Kwpolska” Warrick

unread,
Apr 20, 2014, 10:15:18 AM4/20/14
to Nikola—Discuss
On Sun, Apr 20, 2014 at 2:50 PM, Kay Hayen <kay....@gmail.com> wrote:
> For a wizard, filling it in, probably the system timezone would be OK. I
> even contend
> that users will only ever come to realize that timezones exist with Nikola,
> if you don't
> do this.

> But the user already configured a preferred time zone on the system, why not suggest to use that.

We can try, though this might require hacks, as everyone has a
different solution on how to store the name of the timezone:

Linux A /etc/localtime is a symlink to
/usr/share/zoneinfo/Europe/Warsaw (might also be
/usr/local/etc/localtime)
Linux B echo "Europe/Warsaw" > /etc/timezone
Mac OS X systemsetup -gettimezone (or Linux A)
FreeBSD echo "Europe/Warsaw" > /var/db/zoneinfo if you are lucky
enough (not guaranteed to be true as users can change /etc/localtime
themselves)
*NIX alt export TZ="Europe/Warsaw"
Windows registry (can ask dateutil?)

https://github.com/getnikola/nikola/issues/1255

> Germany, Austria and Switzerland could any day make diverging decisions
> about say the summer
> time rules, so indeed that matters.

DE and AT might not, they’re in the EU which has the same rules. But
they don’t have to stay there forever…

> The other, and better idea for display, would be translate time stamps
> during rendering with a small
> piece of JavaScript. That will make my "UTC" time stamps look good to
> whatever user is reading the
> site.
>
> What do you think Chris?

Makes sense. With http://momentjs.com/ we can even do something like
“5 days ago”, if desired!

https://github.com/getnikola/nikola/issues/1256
Reply all
Reply to author
Forward
0 new messages