How do I convert String to Date or Date to String using GWT 2.0.3?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With the methods on the
java.util.Dateclass itself:parse(String s)andtoString(). 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 ownSimpleDateFormat.