java - The Date(String) is deprecated -
my date
constructor deprecated , highlighted in yellow.
how can use calendar.set()
resolve issue. have called both import java.util.calendar
; , date
.
code below. in advance.
format f = new simpledateformat("yyyy-mm-dd hh:mm:ss z"); date d = new date(f.format(geostate.getstring("firetime"))); temp.setfiretime(d);
use dateformat.parse
method convert string
date
string string = "january 2, 2010"; dateformat format = new simpledateformat("mmmm d, yyyy", locale.english); date date = format.parse(string); system.out.println(date);
in case this
dateformat format = new simpledateformat("yyyy-mm-dd hh:mm:ss z"); date date = format.parse(geostate.getstring("firetime")); temp.setfiretime(date);
Comments
Post a Comment