cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect date format

amit_saroha
New Contributor III

Hi,

My requirement is to pass the date as a string “YYYY/MM/DD HH:MI:SS” as a parameter to Oracle procedure snap. I amssusing the expression - Date.now().toLocaleDateString({“format”:“yyyy/MM/dd HH:mm:ss”}).toString()

I can see the correct format in the value but while it is passed as a parameter it always has additional characters as below -

image

image

Could you please suggest how I can correct this expression?

11 REPLIES 11

SpiroTaleski
Valued Contributor

@amit.saroha

What are the additional characters that you are getting?

The first screen date 2022/06/13 11:57:32 looks fine.

The second one 2022-06-13T12:03:38.000Z has completely different format.

BR,
Spiro Taleski

Yes, when it’s passed as a parameter to Oracle Procedure Snap it changed to 2022/06/13 11:57:32 > 2022-06-13T12:03:38.000Z.

Any way to keep it as 2022/06/13 11:57:32?

image

SpiroTaleski
Valued Contributor

“Yes, when it’s passed as a parameter to Oracle Procedure Snap it changed to 2022/06/13 11:57:32 > 2022-06-13T12:03:38.000Z.” - this shouldn’t happen.

From the screen I can see that the date is mapped from input(“$p_processing_date”). It is not taken from parameter.

If you try to parse the value from parameter as date back, then you will get the “2022-06-13T12:03:38.000Z”.

So, if you procedure expect the field as date, probably you will need to handle the date conversion and format on procedure level. Otherwise, you can pass the field as string(without parsing back as date), directly from parameter: _p_processing_date

BR,
Spiro Taleski

Actually, it’s passed from parameter only, please see below and I couldn’t understand what do you mean by _p_processing_date and where I have to pass it?

image

image