web stats
Convert date regardless of incoming pattern - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09-14-2018, 11:27 AM
OmarAQ OmarAQ is offline
What's HL7?
Join Date: Sep 2018
Posts: 3
OmarAQ is on a distinguished road
Default Convert date regardless of incoming pattern

Hi all;

I am new to Mirth with very little java script knowledge.

I am creating a channel to send an ORM to a PACS server in order to create a MWL, I managed to do so, but there is one problem, I cannot change the date format to: yyyyMMdd.

I searched the forums and found posts talking about this, using the DateUtil.convertDate, but the date I am getting after using it is incorrect (it changes the outcome to yyyyMMdd but not to the correct date).

I think that its because I receive date in multiple formats, mostly as dd-MMM-yy, sometimes as MM/dd/yyyy.

I found below method posted by naruply that changes the format regardless of the inbound message date/time to a specific pattern, no matter what pattern it comes in.


I am stuck here, as I really don`t know what to do with this code, I tried using it in the script section, but I always get: ReferenceError: "convertDate" is not defined.

Would you please help me in this issue.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 03:42 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation