dateTimeFormat

Hi All,

I’m using pub.date:dateTimeFormat service and when the inString is empty its going to exception, is there a way to over come this problem other than writing Java service.

All I need to do is to change the currentPattern to newPattern and sometimes its possible to get empty inString.

System details:
IS - 6.5
Java - 1.4.2

Please let me know your ideas and please let me know if you need more info. Thanks.

What would you like to have happen? Return an empty string? Return the current date/time in the newPattern format?

There are a couple of ways:

  • Where you make calls to dateTimeFormat, test that the inString value you will pass is not null nor empty.

  • Write your own wrapper service in FLOW. Accept the same parameters as dataTimeFormat and do the test there (or any other logic that would make the service “safe” to call in all situations). Then where you would call dateTimeFormat in your other services, call your own service instead. Wrapper services like this are pretty common–and usually placed in package named *Public. Like WmPublic except replace Wm with your company name/abbreviation.

Hope this helps.

Thank you for your quick response. It helped me.