Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17054] Android: Changing device timezone realtime does not alter time

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-06-02T03:08:28.000+0000
Affected Version/sRelease 3.2.2, Release 3.2.3
Fix Version/sn/a
ComponentsAndroid
LabelsSupportTeam
ReporterMostafizur Rahman
AssigneeEric Merriman
Created2014-06-01T04:53:34.000+0000
Updated2017-03-21T20:51:56.000+0000

Description

Problem description

When I display the date/time localized for my timezone it does not update if I change the timezone on the device while the app is running. It maintains the old timezone. This causes the time portion (and possibly the day) to not change as expected.

Test Code

var win = Ti.UI.createWindow({
	backgroundColor : 'red'
});

var btn = Ti.UI.createButton({
	title : 'Now',
	top : 10,
	left : 10,
	width : 200,
	height : 50
});
win.add(btn);
btn.addEventListener('click', function(evt) {
	var d = new Date();
	local.text = d.toLocaleString();
	utc.text = d.toUTCString();
});

var local = Ti.UI.createLabel({
	text : '?',
	top : 100,
	left : 10,
	right : 10,
	height : 50
});
win.add(local);

var utc = Ti.UI.createLabel({
	text : '?',
	top : 200,
	left : 10,
	right : 10,
	height : 50
});
win.add(utc);

win.open();

Step to reproduces:

1) Set timezone of device to Pacific 2) Run the app 3) Tap "Now" button 4) Note that the top date string is localized to Pacific timezone 5) Do not kill the app 6) Open device settings 7) Change timezone to Eastern 8) Go back to app 9) Tap "Now" button 10) Force close the app and relaunch 11) Tap "Now"

Expected Result

The top localized date string displays in Easter time (3 hours ahead)

Result:

The date time still reflect a Pacific timezone *HOWEVER* the displayed timezone is Eastern. The displayed timezone code is just information. It had no bearing on the date time localization.

Comments

  1. Ingo Muschenetz 2014-06-02

    Is this a regression from a previous version?
  2. Ingo Muschenetz 2014-08-14

    3.4.0 is moved forward, and 3.5.0 is taking its place in the calendar.
  3. Chee Kiat Ng 2016-06-02

    Date.toLocaleString() is a native Javascript method, not a Titanium API.
  4. Lee Morris 2017-03-21

    Closing this ticket as the issue is not our bug.

JSON Source