java - How to get human readable date with unix time stamp in milliseconds? -
this question has answer here:
- java: date unix timestamp 8 answers
is there solution without using date
class deprecated, , without having specify format in simpledateformat("yyyy-mm-dd hh:mm:ss.sss")
, since want readable format? thanks
the date
class isn't deprecated - many of constructors/methods are.
you can still use:
string text = new date(millissinceepoch).tostring();
you can't change string format - use system default time zone, example - may enough you.
personally i'd still use either simpledateformat
or better yet java.time
or joda time, if really don't want that, might enough.
Comments
Post a Comment