Announcement

Collapse
No announcement yet.

Convert date/time workable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert date/time workable?

    I used this code to convert sysdate in Oracle and it worked for sometime.

    tmp['PV1']['PV1.44']['PV1.44.1']=DateUtil.convertDate("dd-MMM-yy HH:mm:ss", "yyyyMMddHHmmss", msg['admitted_date'].toString());

    However, once in a while it causes me an error like this.

    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    org.mozilla.javascript.WrappedException: Wrapped java.text.ParseException: Unparseable date: "" (4cc0b33f-2bb9-47f8-9b8e-a980e5c648ef#35)
    at org.mozilla.javascript.Context.throwAsScriptRuntim eEx(Context.java:1693)
    Tonet

  • #2
    Re:Convert date/time workable?

    Sometimes you are getting an empty date from your database?
    Chris Lang

    Comment


    • #3
      Re:Convert date/time workable?

      I don't think so because I get a value on my xml on the raw message. Anyways, I repeated the process an it worked now! Thanks for helping!!!
      Tonet

      Comment


      • #4
        ConvertDate method On DateUtil

        var datestring = DateUtil.convertDate(inpattern, outpattern, date);

        inpattern: The current pattern of the date
        outpattern: The desired pattern for the date
        date: The current date string

        I hope by using these method you can convert date formats

        Comment


        • #5
          How can I understand the inpattern

          Hello
          In my case the inpattern of date may be 'YYYY-mm-dd HH:mm:ss' or even
          While I input a date format 'YYYY-mm-dd' it gives error .So How can I use Dateformat() function that without time

          Comment

          Working...
          X