my dog learned polymorphism*
The moose likes Web Services and the fly likes gson format for Date type property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "gson format for Date type property " Watch "gson format for Date type property " New topic
Author

gson format for Date type property

subash subbu
Greenhorn

Joined: May 25, 2011
Posts: 17
Hi All

i am facing one issue, i want to format one class object into gson format,

that class contains date type property.

any idea regarding this format.

please if you know respond.


that class is

public class Product {

private String productSerialNo;

private String productName;
private String carePackSerialNo;
private Date carePackStartDate;
private Date carePackEndDate;

-- getters and setters---

}

i prepared that format like this
product=={"productSerialNo":"pyd1001","productName":"pydname","carePackSerialNo":"carepack1001","carePackStartDate":null,"carePackEndDate":null}

now i want to put some dates instead of null.

thanks in advance.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: gson format for Date type property
 
Similar Threads
date field in struts
Inserting current date into the database using hibernate
Need to get Date in dd-MM-yyyy format
jsp/tomcat undefined type error
Hibernate Query by Example