0

I am creating a component in ATG which has one Date property. In the document it is mentioned it is parsed by default java.text.DateFormatter (http://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertytypes01.html). I tried to parse Date but is not parsing properly. Please help. Ex: $class=atg.commerce.gifts.GLM queryStartDate=04-07-2014 00:00:00 queryStartDate is a java.util.Date but it is not parsing properly.

anonymous
  • 483
  • 2
  • 8
  • 24

1 Answers1

2

If you are getting parsing exception while trying to pass the date, you can try using SimpleDateFormat in you setQueryStartDate() method of GLM class.

    setQueryStartDate(String queryStartDate){
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("dd-mm-yyyy hh:mm:ss");
                date=sdf.parse(queryStartDate);
        this.queryStartDate=date
        }
Ganesh chaitanya
  • 638
  • 6
  • 18