cancel
Showing results for 
Search instead for 
Did you mean: 

Format Date not working for format (09-06-2023)

Soumya21
Level 6

Hi,

When we are formatting date from 09-06-2023 to 09/06/2023 using calculation stage

I am not getting required format instead its showing old format

Can anyone please help on this.

Thanks,

Soumya
19223.png



------------------------------
Soumya k RPA Developer
RPA Developer
Qualesce India Private Limited
Bangalore
------------------------------
10 REPLIES 10

Hi soumya,

Looks like you are trying to apply date formatting to a text data item. Please convert the data type to date and try the formatting. Refer below.

FormatDate(ToDate([D]), "dd/MM/yyyy")



------------------------------
Athiban Mahamathi ,
SimplifyNext,
Technical Consultant
------------------------------

Hi 

dataitem d is in date format

Thanks,

Soumya



------------------------------
Soumya k RPA Developer
RPA Developer
Qualesce India Private Limited
Bangalore
------------------------------

can you please share the data item screenshot. 



------------------------------
Athiban Mahamathi ,
SimplifyNext,
Technical Consultant
------------------------------

hi

PFA Screenshot19208.png



------------------------------
Soumya k RPA Developer
RPA Developer
Qualesce India Private Limited
Bangalore
------------------------------

Interesting!!! Your BP shows that by default the date is stored as "dd-MM-yyyy". I guess in the calc stage you are trying to store the formatted date to the same variable [d]. Hence the date is stored to the default format though you had applied the formatting.  In your case, please try to store the formatted date to a text data item in the calc stage. Refer below.

19210.png

I can see that my BP sandbox has the default date format as "dd/MM/yyyy".    May I know your BP version? Mine is 7.1.2.

19211.png



------------------------------
Athiban Mahamathi ,
SimplifyNext,
Technical Consultant
------------------------------

Kishore_KumarDe
Level 4

Hi Soumya,

You are not getting the forward slashes(/) because of the Date format of your windows system. I know it is a weird behavior of Blueprism but if Windows date setting have forward slashes then you will get that otherwise it shows "-". As a work around you can use a string replace function as below.

I just replaced spaces with "/"

19214.png

Try that and see if that works for you.



------------------------------
If my answer provided any assistance, please vote as "Best Answer".

Kishore Deka
Lead Software Engineer
EPAM systems

Connect on LinkedIn
https://www.linkedin.com/in/kishoredeka1410/
------------------------------
If my answer provided any assistance, please vote as "Best Answer". Kishore Deka Lead Software Engineer EPAM systems Connect on LinkedIn https://www.linkedin.com/in/kishoredeka1410/

Which version of Blueprism are you using?



------------------------------
Sheela Parthasarathy
Assistant Vice President
Deutsche Bank Group
Pacific/Apia
------------------------------

Hi @Soumya K 

The data items, if set as a date, will default to your system date format meaning after you run the calculation the date in the data item remains the same format. If you change the data item to a text then the calculation format will work and output correctly or use a separate data item to output the formatted date to but this would need to be text item.



------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

Hi,

Yes, we can do like this also, Thank you for response

It was working before now it's not reflecting now when we use in formatDate



------------------------------
Soumya k RPA Developer
RPA Developer
Qualesce India Private Limited
Bangalore
------------------------------