2 Replies Latest reply on Jan 16, 2013 5:10 PM by felix_schmitt-JavaNet

    Date format issue


      I am having an issue with date format. I am trying to change the format of date to dd/MM/yyyy. This is the code I am using:

      <invoke name='format'>
      <new class='java.text.SimpleDateFormat'>

      However, it is throwing an exception: Can't call method format on class java.text.SimpleDateFormat ==> java.lang.IllegalArgumentException: Cannot format given Object as a Date

      Can someone throw some light on this?

      Thanks in advance...

      Edited by: 962330 on Jan 15, 2013 9:57 PM
        • 1. Re: Date format issue
          Are you trying to set the global.HireDate to the current date in that format as a string?

          or are you trying to use it as an argument?

                          <set name="global.HireDate">
                              <invoke name="format">
                                <new class="java.text.SimpleDateFormat">
          I haven't a possibility to test at the moment so I might be far out there :D

          Edited by: Dhurgan on Jan 16, 2013 4:19 PM
          • 2. Re: Date format issue

            you are missing a "Date" object as parameter to the "format" method of the newly generated java.text.SimpleDateFormat.