Announcement

Collapse

Mirth Connect 4.1.0 Released!

Mirth Connect 4.1.0 is now available as an appliance update and on our GitHub page. Mirth Connect 4.1.0 includes new features such as new event log messages, additional fields to the Welcome to Mirth Connect screen, new information included in alerts as well as many smaller changes, updates, and improvements. This release also contains several improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

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