T O P I C R E V I E W |
rixmith |
Posted - 11 Jan 2010 : 18:04:56 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 |
2 L A T E S T R E P L I E S (Newest First) |
rixmith |
Posted - 12 Jan 2010 : 08:15:36 Thanks, that was simple!
Rick |
quinncurtis |
Posted - 11 Jan 2010 : 18:42:22 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); |
|
|