Friday, 23 August 2013

Storing date in .properties file java

Storing date in .properties file java

I am trying to store a date in my config.properties file however the
format is wrong.
try{
prop.setProperty("last_run_time",sdf.format(date));
prop.store(new FileOutputStream("config.properties"),null);
}
catch (Exception e){
e.printStackTrace();
}
The value of sdf.format(date)) is correct e.g. 2013-08-23 02:47 . Issue is
that in the properties file 2013-08-23 02\:47 gets stored. Where does the
'\' come from?

No comments:

Post a Comment