tags:

views:

74

answers:

1

How do I convert String to Date or Date to String using GWT 2.0.3?

+3  A: 

With the methods on the java.util.Date class itself: parse(String s) and toString(). Although the first is deprecated it is the method to use with GWT. If you want more control over how the Date is formatted, when converting to String use the GWT specific class: com.google.gwt.i18n.client.DateTimeFormat. It will format the date given a pattern, similar to Java's own SimpleDateFormat.

Hilbrand