John,
A bit more. LC_ALL should be left alone, but a python program should set
the locale. (See
http://askubuntu.com/questions/795455/python-default-locale-is-not-working)
That advice works for me in a python interpreter
>>> import locale
>>> locale.setlocale(locale.LC_ALL,'')
'en_AU.UTF-8'
>>> import datetime
>>> datetime.datetime.now().strftime("%x %X")
'22/01/17 20:35:56'
I note that weewx code for 3.7 has the engine run the setlocale()
statement. (Tom, was this to fix an issue like this or?... I note that the
commit says to just report the locale but it does more than that).
Cheers
Darryn
On Sunday, January 22, 2017 at 7:33:23 PM UTC+11, Darryn Capes-Davis wrote:
> John,
>
> I have done a bit of thinking and testing on my Ubuntu setup. Three things
> here.
>
> 1. Missing LC_ALL is an issue. Find your favourite information to fix on
> Google.
> 2. Missing LC_ALL will mean "%x %X" will give what you are seeing on
> index.html
> 3. I expect that Niculskin code for localising strings is giving havoc to
> weewx ConfigObj code and making weewx.conf override skin.conf (just a
> guess).
>
> Fixes?
>
> A. Fix LC_ALL (Looks like setting in /etc/environment is best bet). Can
> test by running in python interpreter .
>
> You will see for me, where I also have the LC_ALL issue, I get the wrong
> format with "%x %X", even though the rest of my LC_X and en_AU.
>
> >>> import datetime
> >>> datetime.datetime.now().strftime("%x %X")
> '01/22/17 19:16:00'
>
> B. Since you don't need Niculskin localisation, you can not use the
> Niculskin binaries CheetahGeneratorTranslated. Revert back to
> weewx.cheetahgenerator.CheetahGenerator.
>
> Good luck.
>
> Cheers
>
> Darryn
>
> On Sunday, January 22, 2017 at 3:07:11 PM UTC+11, gjr80 wrote:
>
>> You did stop/start or reload weewx after making changes to weewx.conf?
>> Not required for changes to skin.conf but is required for weewx.conf
>> changes.
>>
>> Gary
>>
>> On Sunday, 22 January 2017 00:56:30 UTC+10, John Rye wrote:
>>
>>>
>>>
>>> On Sunday, 22 January 2017 01:08:11 UTC+13, Darryn Capes-Davis wrote:
>>>>
>>>> John,
>>>>
>>>> > What locale is your server?
>>>>
>>>
>>> [lists@amd64 ~]$ locale
>>> LANG=en_NZ.UTF-8
>>> LC_CTYPE="en_NZ.UTF-8"
>>> LC_NUMERIC="en_NZ.UTF-8"
>>> LC_TIME="en_NZ.UTF-8"
>>> LC_COLLATE="en_NZ.UTF-8"
>>> LC_MONETARY="en_NZ.UTF-8"
>>> LC_MESSAGES="en_NZ.UTF-8"
>>> LC_PAPER="en_NZ.UTF-8"
>>> LC_NAME="en_NZ.UTF-8"
>>> LC_ADDRESS="en_NZ.UTF-8"
>>> LC_TELEPHONE="en_NZ.UTF-8"
>>> LC_MEASUREMENT="en_NZ.UTF-8"
>>> LC_IDENTIFICATION="en_NZ.UTF-8"
>>> LC_ALL=
>>> [lists@amd64 ~]$
>>>
>>> So physically in New Zealand as is the server.
>>>
>>>
>>>> > I ask as the only way you would be getting the display on your site
>>>> would be from the format string "%x %X" on a US locale server.
>>>>
>>>
>>> Agreed. However I have altered all the time format strings in
>>> weewx.conf in line with what is shown in
>>> http://weewx.com/docs/customizing.htm#Units_TimeFormats. I don't see
>>> any point in going further and custominsing as per strftime - it shouldn't
>>> be necessary
>>>
>>>>
>>>> > However I can't see how the format "%x %X" would be being used?
>>>>
>>>
>>> I'm beginning to wonder if its hard-coded in the javascript (/me
>>> shudders) because I'm fairly sure I was able to alter the formatting in the
>>> Standard skin.
>>>
>>> Cheers
>>>
>>> John in NZ
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.