Change timezone for rules

260 views
Skip to first unread message

letn...@gmail.com

unread,
Oct 10, 2014, 12:58:04 AM10/10/14
to ope...@googlegroups.com


I'm trying to put current date and time in a DateTimeType item but i have the wrong timezone, my local time is 6 hours earlier.
I try change the timezone in Start.sh file for ntp="Canada/Eastern", it doesn't work.
I try new DateTimeType().minusHours(6) and it doesn't work.
I try to make a DateTimeType with now.get.....  but it don't want to transfert from DateTime to DateTimeType.


I rely need your help on this.

Thank you



Christoph Wempe

unread,
Oct 10, 2014, 4:57:48 AM10/10/14
to ope...@googlegroups.com, letn...@gmail.com
I had a similar problem when I installed openhab on ma QNAP NAS, where java got the wrong timezone from the system.

Check your log entries to see if java in general uses the correct timezone.
This helped me with my problem on my QNAP:

letn...@gmail.com

unread,
Oct 10, 2014, 4:39:18 PM10/10/14
to ope...@googlegroups.com, letn...@gmail.com
Thx Christoph Wempe for your fast answer but

i think you refer to this line of code in your forum


export TZ=`/sbin/getcfg System "Time Zone" -f /etc/config/uLinux.conf`

but i don't know how do make it on my pcduino and add it to openhab config file.

letn...@gmail.com

unread,
Oct 11, 2014, 1:09:00 AM10/11/14
to ope...@googlegroups.com, letn...@gmail.com
I got something

i change my item file with ntp like this

DateTime cpu_last_update    "Last Update cpu [%1$tA, %1$td.%1$tm.%1$tY %1$tT]"    <clock>    { ntp="America/Montreal" }

and i got the right time but when i postUpdate(cpu_last_update, new DateTimeType()) i still got +5 hours with my real time.

And how the item Date in the demo configuration change State ? no rules with Date in it so how it change ?


letn...@gmail.com

unread,
Oct 13, 2014, 12:17:38 AM10/13/14
to ope...@googlegroups.com, letn...@gmail.com
My date and time is good but only for the first time, when i postUpdate(cpu_last_update, new DateTimeType()) i got +4 hours for my timezone.

Can someone help me plzzz

Phil

unread,
Oct 14, 2014, 9:37:15 AM10/14/14
to ope...@googlegroups.com, letn...@gmail.com

On Monday, October 13, 2014 6:17:38 AM UTC+2, letn...@gmail.com wrote:
My date and time is good but only for the first time, when i postUpdate(cpu_last_update, new DateTimeType()) i got +4 hours for my timezone.

Can someone help me plzzz
 
To me, this sounds like the JVM has the wrong timezone.
 
Couldn't you add "-Duser.timezone=GMT" (replace GMT with with your Java TZ code) to you Java Parameters?
Like, for example, to the DAEMON_ARGS if you're using the Linux init.d script. Also, I think this should be fixed system wide - from wherever Java gets its property.
 
HTH,
Phil

letn...@gmail.com

unread,
Oct 14, 2014, 10:52:31 PM10/14/14
to ope...@googlegroups.com, letn...@gmail.com
i try this lastime but this week-end i change my server for version 1.5.1.

I try it today and i work thanks alot for your help Phil
Reply all
Reply to author
Forward
0 new messages