How to convert java.util.Date to String in GWT client side
In GWT we use SimpleDateFormat in Client side it throws the compiling error.
so use DateTimeFormat instead of SimpleDateFormat.
String currentdate="";try{DateTimeFormat dateFormat =DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");currentdate= dateFormat.format(new Date());} catch (Exception e){e.printStackTrace();}
0 comments:
Post a Comment