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
Post a Comment