Problem with DateTime at start (set UTC)

Hi!!

I have a problem with the datetime in the linux side. Im from Santiago-Chile and i need to set the yun to my local datetime (UTC Americas/Santiago). I configure in the Yun homepage other similar country (like Mendoza-Argentina) because Chile isn`t in the Yun list.
--> The problem begin when the Yun Start and the software (in the linux side) show the mysql query now() and show a fake datetime . I imagine that is because at start the yun dont has inmediatly internet conection. This cause that all my "aplications process" finished because the datetime are fake at start :).

How can i set a permanent correct datetime and start the aplications whit his querys when it has internet connection and mysql has the correct datetime of my country? Thanks!!

Time zone setting for Santiago-Chile:

Santiago-Chile use Chile Standard Time - CLT

Daylight Saving Time table of

2015 Sun, Apr 26, 12:00 AM CLST → CLT No offset (DST end, TZ change) UTC-3h
2016 — 2018 No known changes, UTC -3 hours all of the period

nano /etc/config/system
...
option timezone CLT3
...

It is good up to year 2018.

Time discrepancy at booting time:

mysql server start init:

nano /etc/init.d/mysqld
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2011 OpenWrt.org

START=95
STOP=10
...

ntpd time sync client init:

nano /etc/init.d/sysntpd
#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org

START=98
...

sync time after mysql fully start, change it as something like:

#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org

START=60
...

Let us first sync time then make mysql start.

Thanks for all! I change the CLT3 timezone ok and restart my Yun .

I have a question with mysql:

In the files i have that:

nano /etc/init.d/mysqld (I dont change anythink because it is at 'START=95')

#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2011 OpenWrt.org

START=95
STOP=10

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
SERVICE_STOP_TIME=9

And in nano /etc/init.d/sysntpd (i change the 'Start=95' with 'Start=60')

#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org

START=60

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
SERVICE_PID_FILE=/var/run/sysntpd.pid

I need to change other file? Is all ok with this?

root@Arduino:~# /etc/init.d/sysntpd  disable
root@Arduino:~# /etc/init.d/sysntpd  enable
root@Arduino:~# reboot

sonnyyu You are a crack man. Thanks for your goods vibrations :wink:

muchas gracias

Bro the problem of the datetime of mysql at start continue. I think this is when i turn on the yun, it take a time to connect to de wifi (in this moment the mysql sync the datetime and has a fake datetime). When connect all is ok. How can i run the system only if I have internet connection? . If the Yun run without internet connection it has fake mysql datetime sync :frowning:

I need: if ping-----> do that

please!!

Connect with RTC (Real-time clock) module, cost few $.