cancel
Showing results for 
Search instead for 
Did you mean: 

Convert date

jacobitwaco
Level 3
Spoiler
Hello Guys,

I would like to convert date from the format 01.09.2024 for 01/09/2024. Date is saved in a date Item as a text and I wrote the expression in a Write Stage, but It still doesnt work. Maybe I wrote uncorrectly the expression. I used a comma as a separator too but it still doesnt work. BluePrism Version 7.2.0. Do you have some ideas ?

Zrzut ekranu (632).png

2 REPLIES 2

Hi @jacobitwaco 

I have attached screenshot for your ref, Please check it will help you.

99.png

 

Thanks

Nilesh

Nilesh Jadhav.
Consultant
ADP,India

Hi @jacobitwaco ,


Since, you have mentioned that you even used a comma as a separator in your expression before which is actually the right way, I am pretty sure this issue is because of your regional format which pretty often confuses a lot of people.

The FormatDate function in Blue Prism is primarily dictated by the regional settings of the machine it's running on. If your system's default date separator is a hyphen (-), then Blue Prism will use that separator despite the specified format which you would use which in your case is forward slash (/). If your regional setting already has '/' characters then you normally can use the expression as I showed below without any extra Replace function otherwise you will need to update the expression a bit.


As you can see in my case, the regional format of my machine is dd-MM-yyyy:

devneetmohanty07_0-1720383210314.png


So here, even if I use the correct calculation function, still it would not work:

 

FormatDate([Departing Date], "dd/MM/yyy")

 

devneetmohanty07_2-1720383395296.png

 

The way to avoid this is to either change your regional settings which in most cases would not be advised as it will affect a lot of applications like excel for instance on your machine. Hence, better approach is to use an updated version of the formula which will manually replace the hyphen (-) characters with forward slash (/) characters once you use FormatDate function:

 

Replace(FormatDate([Departing Date], "dd/MM/yyy"), "-", "/")

 

devneetmohanty07_3-1720383643271.png

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.