Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 Showing time axis labels in a different timezone
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

PeterJ

26 Posts

Posted - 19 May 2010 :  15:40:13  Show Profile  Reply with Quote
My machine is in PDT but I would like the time axis labels to appear in GMT. Is this possible?

quinncurtis

1586 Posts

Posted - 19 May 2010 :  15:55:36  Show Profile  Reply with Quote
The time axis labels are not based on any time zone. Initialize the GregorianCalendar (a Java class) values of your data to GMT and the time axis labels will follow. You can just add 7 hours to your PDT GregorianCalendar values and call it GMT.

for (int i=0; i < timedatevalues.length; i++)
timedatevalues[i].add(Calendar.HOUR,7);


You can't have the raw data in PDT and the time axis labels in GMT. The labels, coordinate system and raw data must all be in the same units.
Go to Top of Page

PeterJ

26 Posts

Posted - 19 May 2010 :  18:06:58  Show Profile  Reply with Quote
Thank you.

I'm putting in a Gregorian calendar with the time zone set to TimeZone.getTimeZone("GMT"). However, output is in PDT (my local time zone).
Go to Top of Page

quinncurtis

1586 Posts

Posted - 19 May 2010 :  19:03:58  Show Profile  Reply with Quote
As far as we know, you MUST set the time values as they would be in GMT, and not expect the GregorianCalendar class do any conversion, no matter what you set the time zone to. This is why we said to add 7 hours to the PDT values.
Go to Top of Page

PeterJ

26 Posts

Posted - 19 May 2010 :  22:53:27  Show Profile  Reply with Quote
We found the source of the problem.

In your TimeAxisLabel.dateToASCII method you have the following code:

SimpleDateFormat formatter
= new SimpleDateFormat (sformatstring);

It does not respect the plot's timezone so we added the following line
formatter.setTimeZone(tDate.getTimeZone));

We now have time axis labels displayed in the timezone of our input calendar.

We cannot add the 7 hours as we don't always know what timezone our user will be in. The plots always have to present time axis labels in GMT.

Any chance of investigating and fixing this method as we don't want to have to maintain a patch?

Edited by - PeterJ on 19 May 2010 22:55:57
Go to Top of Page

quinncurtis

1586 Posts

Posted - 19 May 2010 :  23:21:22  Show Profile  Reply with Quote
We will consider your change as some sort of option, since it may have undesired effects if implemented across the board. Use it and let us know if any problems arise.
Go to Top of Page

PeterJ

26 Posts

Posted - 20 May 2010 :  10:27:24  Show Profile  Reply with Quote
Thank you again for the very prompt response. Support of this quality makes a big difference when selecting between plotting packages.

My suggestion would be the addition of a method to set label time zone. My industry (space and aerospace) together with military applications tend to want time presented in GMT/UTZ/Zulu regardless of the user's actual location.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07