Page 3 of 8
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:01 am
by sectroyer
zoelechat wrote:I precisely read posts above and that's why I asked the question "is it a wanted behavior?"
Isn't it necessary to set timezone when you're not in UTC zone? (maybe your app should do it automatically? Using this famous offset)
What I see is just that "date -u" value is wrong, giving localtime instead of expected UTC time. I don't know if that can really be a problem (especially when sync is needed...)

On linux you don't set a time zone using any api. You do it this way:
Code: Select all
ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime
If you want to use your time zone and not UTC set time using -u switch and make correct link. I have one TV configured this way

Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:15 am
by zoelechat
I'd already tried to set timezone but starting with wrong UTC was not compliant...
This --utc switch does the job perfectly, thanks!

(Now files written by TV have the right date/time, no more "1 hour later" offset

)
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 10:59 am
by sectroyer
zoelechat wrote:I'd already tried to set timezone but starting with wrong UTC was not compliant...
This --utc switch does the job perfectly, thanks!

(Now files written by TV have the right date/time, no more "1 hour later" offset

)
It really depends what you want to achieve

Now you have wrong time in date

Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:28 pm
by zoelechat
sectroyer wrote:It really depends what you want to achieve

Certainly
sectroyer wrote:Now you have wrong time in date

No, UTC is
Universal, Unique and due to be the same all over the world with no offset, now it is correctly set all times and timezones are correct.

Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:33 pm
by sectroyer
zoelechat wrote:sectroyer wrote:It really depends what you want to achieve

Certainly
sectroyer wrote:Now you have wrong time in date

No, UTC is
Universal, Unique and due to be the same all over the world with no offset, now it is correctly set all times and timezones are correct.

I know it's universal. If you have set up the timezone correctly than yes you have everything okay. What is your TV? I know on C setting timezone is not trivial

It's quite easy on E. Not sure about others

Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:51 pm
by zoelechat
sectroyer wrote:I know it's universal. If you have set up the timezone correctly than yes you have everything okay. What is your TV? I know on C setting timezone is not trivial

It's quite easy on E. Not sure about others

My TV is E and I didn't succeed in setting any timezone yet, I don't want to touch to TV protected files ('localtime') until I'm really sure of what I'm doing (maybe you can lead me to a safe step-by-step procedure?

)
I just tried local 'export TZ' that gave me expected result and I noticed that TV files through Samba server are now sync to client time, even without timezone set...
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 12:55 pm
by sectroyer
export TZ seems to also work. However on E you can notice something like this:
Code: Select all
ls -l /etc/localtime
lrwxrwxrwx 1 root 0 19 Feb 18 2013 /etc/localtime -> ../tmp/CSP_TimeZone
so /etc/localtime points to not existent file in /tmp/

You can just copy correct local time to that place.
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 1:12 pm
by zoelechat
Yeah, export TZ works but it affects only local (for example launched in a script, timezone concerns only script itself

)
Nice, I didn't notice that localtime thing, now I have to find a timezone file to put in /tmp...
edit: ok, found (no Linux there but got one in Cygwin). Works perfectly!
Code: Select all
date -u
Sun Mar 2 12:11:09 UTC 2014
date
Sun Mar 2 13:11:09 CET 2014
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 1:24 pm
by sectroyer
On C (D?) it is not so easy. There is no /etc/localtime so export TZ seems the only option. However you can do one more thing (I did it

). The location of local time is stored in libc. You can mount copy original libc to $SYSROOT/opt/lib/libc.so.6. Then you open it in any hex editor of your choosing and change strings /etc/localtime to /dtv/locatime. The last thing is to
Code: Select all
mount -o bind $SYSROOT/opt/lib/libc.so.6 /lib/libc.so.6
And finally copy correct localtime file to /dtv/.
Now you have correct timezone on C(D?).
Re: [App] Get/Set Current Time From TV C/D/E
Posted: Sun Mar 02, 2014 1:45 pm
by greenhorn
@sectroyer
If I apply the time patch after the movie seek patch, I loose the movie seek patch settings.