These are chat archives for mycontroller-org/mycontroller

Aug 2016
Alex Manusovich
Aug 13 2016 03:26
Does someone have issues with timezone on raspberry pi 3, oracle jvm? Mycontroller is not picking right timezone. After i tried all internet options, i just created simple java class to check what tz jvm returns and it returns right value. But mycontroller is still showing UTC.

i've used this code for test:
import java.util.;
import java.text.
class simpleTest
public static void main(String args[])
System.out.println("Simple test Josh ");
Date now = new Date();
DateFormat df = DateFormat.getDateInstance();
Calendar cal = Calendar.getInstance();
System.out.println("\n TIME ZONE :"+ cal.getTimeZone().getDisplayName());
long nowLong = now.getTime();
String s = now.toString();
System.out.println("Value of milliseconds since Epoch is " + nowLong);
System.out.println("Value of s in readable format is " + s);



pi@rpi:~/mycontroller/bin $ date
Fri 12 Aug 22:28:36 CDT 2016

pi@rpi:~ $ java simpleTest
Simple test Josh

TIME ZONE :Central Standard Time
Value of milliseconds since Epoch is 1471058469669
Value of s in readable format is Fri Aug 12 22:29:09 CDT 2016

But in the browser ...
MyController time
03:29:09 AM
Aug 13, 2016, UTC (+0000)
Even in the MC logs i see right time
2016-08-12 22:23:16,528 INFO [main] [org.mycontroller.standalone.StartApp:209] TJWS server started successfully, HTTPS Enabled?:false, HTTP(S) Port: [8443]
2016-08-12 22:23:16,539 INFO [main] [org.mycontroller.standalone.StartApp:107] server started in [7142] ms
Alex Manusovich
Aug 13 2016 03:31
So do we have somewhere TZ in the settings or it should pick up that from the system? May be i have to setup TZ manually for MC?
Jeeva Kandasamy
Aug 13 2016 13:26
@manusovich It is because MyController changes time to clients timestamp to avoid confusions when you configure timers
Alex Manusovich
Aug 13 2016 15:43
@jkandasa You are right. But i figured out why it is displaying wrong date only after i looked the code :) So apparently you are getting timezone only during user login. So what happened with me - i installed MC on fresh raspberry. Then i realized that timezone on my RPI is wrong. I changed that. But MC was still using old time zone because i still have token in cookies. It will be updated only if you will mare logout and login again
Jeeva Kandasamy
Aug 13 2016 16:51
@manusovich you are right, we have to document this or every N minute once we have to update cookies from controller