Javascript – Timezone and DST problems on the latest 2014 Samsung Smart TV firmware


I have 2 Samsung Smart TVs with the following model and firmware (from TV Menu->Support->Contact Samsung screen)

  1. 2013:

    • Model Code: UN32F5500
    • Software Vesrion: T-MST12AKUC-1121.3
  2. 2014:

    • Model Code: UN40H6350
    • Software Vesrion: T-MST14AKUC-1115.3

The first problem (reproduced on both TVs, 2013 & 2014) is the timezone is detection is wrong. The following code:

<script type='text/javascript' src='./$MANAGER_WIDGET/Common/af/../webapi/1.0/deviceapis.js'></script>
// ...
var timezone =;
window.alert('Timezone=' + timezone.timezone + ', dst=' + timezone.dst);

outputs the following:

Timezone=2, dst=0

This is PL_TV_TIMEZONE_EASTERN whereas I'm in the PST timezone, i.e. the following output is expected (5 is PL_TV_TIMEZONE_PACIFIC, and daylight savings time is active now):

Timezone=5, dst=1

The most weird thing is that I'm not able to change the TV's timezone and DST setting. If I go to the TV's Menu->System->Time->Clock, then the 'DST' and 'Time Zone' settings are disabled (grayed out) even if the 'Clock Mode' setting is set to 'Manual'.

The second problem is specific for the 2014 TV, it's not reproduced on the 2013 TV. The Date's getUTCHours() method returns wrong result not taking into account Daylight Saving Time Shift. That is, the following code:

var now = new Date();
window.alert('now: ' + now + '; getUTCHours()=' + now.getUTCHours());

produces the following output:

now: Fri Aug 08 2014 18:12:52 GMT-0800 (GMT), getUTCHours()=2

whereas the following is expected (as on my 2013 TV):

now: Fri Aug 08 2014 18:12:52 GMT-0700 (PDT); getUTCHours()=1

The current time (Fri Aug 08 2014 18:12:52) is correct but the DST offset is not taken into account in the returned GMT time's hour. Also, timezone code in the parenthesis is wrong (GMT instead of PDT or rather, taking into account timezone error described above, EDT or EST).
I observed this problem just recently, I think it appeared after I made Software Update for the 2014 TV. I'd rather think this is a bug introduced in the latest version of the firmware.
I tried to use TV plugin's (clsid:SAMSUNG-INFOLINK-TV) GetDST(), GetTimeZone(), GetTimeZone_Offset() functions, but all of them return incorrect results.

I'd very appreciate any help provided.

Thank you!

Best Solution

I just contacted Samsung support, and they suggested that the Input had to be set to "TV" before entering setup to have access to the Timezone and the other parameters.

Related Question