Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What transformer can I use to put a date into YYYY - MM - DD format with no time format in final result?

Tags:

webmethods

I just started using webMETHODS today and need to transform a date input value that comes in like this.

Example:

yyyy-mm-dd hh:mm:ss:hh

I need just the date portion of this variable and am currently using pub.date:formatDate which will crash my flow service.

What should I be using?

This is what I see on my WEBMethods screen!


2 Answers

An alternative would be to use pub.date:dateTimeFormat, which allows you to set an input pattern, for example dd.MM.yyyy hh:mm:ss.

like image 76
Christian Strempfer Avatar answered Jan 25 '26 01:01

Christian Strempfer


pub.date:formatDate is used to convert a date input to a string output based on a string pattern. Here you are trying to convert a string input to a string output.

You have to do the following: a. First convert the string (Process_date_orig_str) to date format (Process_date_dt) b. Then use the date (Process_date_dt) to the required string format using pub.date:formatDate to get (Process_date_new_str)

Note: You will have to create your custom java service to convert string to Date.

like image 36
Nishanthi Grashia Avatar answered Jan 25 '26 02:01

Nishanthi Grashia