java - GetTime doesn't correctly display zero's -
i use timestamps in system. works correctly, find annoying have [12:2:2] timestamp. because don't know if it's 20 or 2.
i tired , sick, , starting think compiler.
java.util.date date= new java.util.date(); timestamp time = new timestamp(date.gettime()); super.print("[" + time.gethours() + ":" + time.getminutes() + ":" + time.getseconds() + "] ");re
how guys correct timestamps zero's?
have @ dateformat or simpledateformat class.
simpledateformat df = new simpledateformat("hh:mm:ss"); df.format(new date());
Comments
Post a Comment