convert str time to kml timeStamp in java -
i building kml file , there line of timestamp:
<gx:timestamp> <when>2002-07-09t19:00:00-08:00</when> </gx:timestamp>
i need convert time like: "1430477311" "2002-07-09t19:00:00-08:00" format
how ? (java code) tnx lot
you wanting convert timeformat xml date format (iso-8601) -
long timestamp = 1430477311l; java.util.date yourdate = new java.util.date(timestamp*1000); //ms simpledateformat yyyymmddthhmmsssdf = new simpledateformat("yyyy-mm-dd't'hh:mm:ssx"); string date = yyyymmddthhmmsssdf.format(yourdate);
Comments
Post a Comment