How do I save and load the current time in java? -


i need able save , load current time in java. use system.currenttimemillis() store in long, need able write out in different formats, like; "yyyy-mm-dd", "dd/mm hour:min:sec", , such.

the program save time got system.currenttimemillis() txt file, if happens computer or program needs able go right it's task.

you can use code similar following

string formatted = new simpledateformat("yyyy-mm-dd").format(new date(system.currenttimemillis())); 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -