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
 TimeGroupDataset.writeGroupDataset(csv, filename)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rixmith

26 Posts

Posted - 11 Jan 2010 :  18:04:56  Show Profile  Reply with Quote
I'm trying to save my TimeGroupDataset to a file. I used the code below:

CSV csv = new CSV();
csv.setTimeDateFormat(new SimpleDateFormat ("dd-MMM-yyyy HH:mm"));
dataset.writeGroupDataset(csv, "output.csv");

The output.csv file is created but the dates in the file aren't formatted. The dates are just numbers expressed in scientific notation like: 1.23628296E12.

a) Is this how dates are supposed to be output to the csv file?

b) When I try to create a new TimeGroupDataset using the output file produced above and the same CSV instance I get incorrect results because all the dates in the new TimeGroupDataset are 0.

What am I doing wrong?

Rick

quinncurtis

1164 Posts

Posted - 11 Jan 2010 :  18:42:22  Show Profile  Reply with Quote
You should be using writeTimeSimpleDataset and readTimeSimpleDataset.

csv.setTimeDateFormat(new SimpleDateFormat ("dd-MMM-yyyy HH:mm"));


Dataset1.writeTimeSimpleDataset(csv, "c:\\SimpleBar.csv");

Dataset1.readTimeSimpleDataset(csv, "c:\\SimpleBar.csv",0,0);
Go to Top of Page

rixmith

26 Posts

Posted - 12 Jan 2010 :  08:15:36  Show Profile  Reply with Quote
Thanks, that was simple!

Rick
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07