Skip to Content
avatar image
Former Member

Date display

Hi ,

i have a table with data and in one column i have dates.I have 2 dates in row in dates column(yyyy-mm--dd) format .How to change these two dates in dd/mm/yyyy and some rows i have only single date.

_____________

2009-11-09

2008-12-01

____________

With Regards,

suresh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 06, 2009 at 04:42 AM

    Hi Suresh,

    Create a simple data type of type java.sql.date and give the format in it as "dd/MM/yyyy". Please revert back incase you need any further information on this.

    Thanks and Regards,

    Pravesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Suresh,

      This is purely a JAVA code and your technique of how you could distinguish between the multiple dates coming from the RFC element. probably I could just give you a hint.

      Let us assume that you are getting the multiples dates seperated by a comma (","). Then the logic should be like:

      String NDD = care.getNextDD().trim().toString();
      	  
      	  String dates[] = NDD.split(",");
      	  String tempDate= "";
      	  String finalDate = "";
      	  
      	  if(date.length()>0){
      		  tempDate = getFormatedDate(dates[0]);
      		  finalDate  = finalDate + tempDate;
      	  }
      

      then you could pass each string to the method where you will get the output as the string.

      Also you function getFormatedDate should look like this:

      public String getFormatedDate(String date){
      		  String finalDate = "";
      		  if(date!=null && !date.equalsIgnoreCase("")){
      		  finalDate = date.substring(8)+"/"date.substring(5,7)"/"+date.substring(0,4);
      		  }
      		  return finalDate ;
      
      	  }
      

      I hope this could help you to solve the issue. However, you need to decide upon the exact logic which you need to implement in this case.

      Thanks and Regards,

      Pravesh