java - Writing dates in csv files, some output as ###### -


i writing application let threads write csv files random numbers , random dates. however, of dates output ######, when click them in excell, show correct date (e.g.11/4/2014 shows ###### in excell, when click on cell, in fx field show 11/4/2014).

here how write dates:

    random random = new random();     bufferedwriter bufferedwriter;     gregoriancalendar cal = new gregoriancalendar();     dateformat df = new simpledateformat("dd/mm/yyyy");       writeline(random, bufferedwriter, cal, df);  private void writeline(random random, bufferedwriter bufferedwriter, gregoriancalendar cal, dateformat df) throws ioexception {         string randomdatestring;         bufferedwriter.write(double.tostring(random.nextdouble() * 100));         bufferedwriter.write(",");         randomdatestring = createrandomdate(random, cal, df);         bufferedwriter.write(randomdatestring);         bufferedwriter.newline();     }   private string createrandomdate(random random, gregoriancalendar cal, dateformat df) {         int randomdayoftheyear;         date randomdate;         string randomdatestring;         randomdayoftheyear = random.nextint(365) + 1;         cal.set(calendar.year, 2014);         cal.set(calendar.day_of_year, randomdayoftheyear);         randomdate = cal.gettime();         randomdatestring = df.format(randomdate);         return randomdatestring;     } 

###### piece of text excel uses mark cells not wide enough display entire number within them. happens numbers. writing csv file correctly. have expand column in excel can display whole date.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -