Timezone problem of datetime object in annotated timeline

143 views
Skip to first unread message

Hanwen

unread,
Apr 10, 2009, 8:15:09 AM4/10/09
to Google Visualization API
Dear all,

I got a problem with the date object in annotated timeline,
and I wonder if you had similar problems before and had a solution.

I am using Firefox 3.0.6 in Taiwan, where the timezone is GMT+8.
So if I have a data object s = new Date(2008, 11, 19, 12, 37, 36) and
print it with alert, it says "Fri Dec 19 2008 12:37:36 GMT+0800
(Taipei Standard Time)."
If I use setVisibleChartRange(s, t), the range starts from "Fri Dec 19
2008 12:37:36 GMT+0800 (Taipei Standard Time)."

And I create a dataset whose first element starts from Date(2008, 11,
19, 12, 37, 36).
But when the chart is ready, and I call getVisibleChartRange, the
start time becomes "Fri Dec 19 2008 20:37:36 GMT+0800 (Taipei Standard
Time)", which adds another 8 hours to the time I set.

So I am confused now whether I should give local time in the dataset
or the UTC time so the visualization cn be constructed correctly.
And how can I set a date object to a specific timezone?

I appreciate your help if you can provide any help.
My code is at the following link.
http://clover.csie.org/~chanwen/MyLBS/annotatedTimeline.html
You can test it as a reference.

Thanks for your help.

Hanwen

Hanwen

unread,
Apr 22, 2009, 8:38:17 AM4/22/09
to Google Visualization API
So no one ever meet this timezone problem when controlling the chart
range?
I need some suggestions, thanks.

On Apr 10, 8:15 pm, Hanwen <Hanwe...@gmail.com> wrote:
> Dear all,
>
> I got a problem with the date object in annotated timeline,
> and I wonder if you had similar problems before and had a solution.
>
> I am using Firefox 3.0.6 in Taiwan, where the timezone is GMT+8.
> So if I have a data object s = new Date(2008, 11, 19, 12, 37, 36) and
> print it with alert, it says "Fri Dec 19 2008 12:37:36 GMT+0800
> (Taipei Standard Time)."
> If I use setVisibleChartRange(s, t), the range starts from "Fri Dec 19
> 2008 12:37:36 GMT+0800 (Taipei Standard Time)."
>
> And I create a dataset whose first element starts from Date(2008, 11,
> 19, 12, 37, 36).
> But when the chart is ready, and I call getVisibleChartRange, the
> start time becomes "Fri Dec 19 2008 20:37:36 GMT+0800 (Taipei Standard
> Time)", which adds another 8 hours to the time I set.
>
> So I am confused now whether I should give local time in the dataset
> or the UTC time so the visualization cn be constructed correctly.
> And how can I set a date object to a specific timezone?
>
> I appreciate your help if you can provide any help.
> My code is at the following link.http://clover.csie.org/~chanwen/MyLBS/annotatedTimeline.html

VizGuy

unread,
Apr 23, 2009, 5:51:00 AM4/23/09
to google-visua...@googlegroups.com
Hi,
So to see that I get the problem.

The chart displays the times as local, so if you have a date of local time 10, it will show up like 10 in the chart, but you say that when you set the visible range to 10 you see something else?

Regards,
VizGuy

Hanwen

unread,
Apr 23, 2009, 9:13:23 AM4/23/09
to Google Visualization API
Yes, I have a set of date object from local time 12:37 to 12:53
(+08:00), it shows 12:37 to 12:53 in the chart x-asis, but the visible
range becomes 20:37 to 20:53.
http://clover.csie.org/~chanwen/MyLBS/annotatedTimeline.html

The problem is not the setVisibleRange and getVisibleRange function;
if I set visible range 10:20 to 12:20, the range becomes 10:20 to
12:20.
(You can test by clicking the "set range" button and then the "get
range" button.)

The problem is that in the data table, the date are from 12:37 to
12:53, but chart draw the data from visible range 20:37 to 20:53 (but
displayed in 12:37 to 12:53).
(You can see my source code that the data are from 12:37 to 12:53, but
if you just click "get range" button after loading, it tells 20:37 to
20:53)

Thanks a lot for your kindly help.

Hanwen

On Apr 23, 5:51 pm, VizGuy <viz...@google.com> wrote:
> Hi,So to see that I get the problem.

VizGuy

unread,
Apr 23, 2009, 11:00:15 AM4/23/09
to google-visua...@googlegroups.com
Ok.

After a short investigation, it seems like our bug.
For the chart values, we intentionally ignore the time zone, so if you have a date with local 12:00, you see it as 12:00 in the chart.
Yet, on the range, we do not ignore the time zone, and so when your date is 12:00 +8, we zoom to 4:00 am in the day before.

I hope this is what you were describing.

We will look into fixing this issue, and will notify before it goes live, so users who already rely on the current behavior, have chance to modify to the new way.

Thanks,
VizGuy

Hanwen

unread,
Apr 23, 2009, 10:14:30 PM4/23/09
to Google Visualization API
Yes, that's my problem. Thanks a lot for your help, and wish to see
it fixed as soon as possible.

Hanwen

Tamar Hardy

unread,
Jun 28, 2013, 2:37:54 PM6/28/13
to google-visua...@googlegroups.com
This still seems to be an issue. Was it ever resolved.?

asgallant

unread,
Jun 28, 2013, 2:56:43 PM6/28/13
to google-visua...@googlegroups.com
If it wasn't resolved before, it is unlikely to be resolved in the future, as the ATL charts are old, and their functionality is replicated in the newer charts.  A LineChart with a ChartRangeFilter replicates the functionality while avoiding the drawbacks of the ATL and Flash.  I wrote a migration tool you can test out the new charts with that allows you to reuse most of your ATL chart code.
Reply all
Reply to author
Forward
0 new messages