09-06-23 07:02 AM
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
09-06-23 07:40 AM
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")
09-06-23 08:03 AM
Hi
dataitem d is in date format
Thanks,
Soumya
09-06-23 08:13 AM
can you please share the data item screenshot.
09-06-23 09:47 AM
hi
PFA Screenshot
09-06-23 10:13 AM
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.
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.
09-06-23 10:15 AM
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 "/"
Try that and see if that works for you.
09-06-23 10:17 AM
Which version of Blueprism are you using?
------------------------------
Sheela Parthasarathy
Assistant Vice President
Deutsche Bank Group
Pacific/Apia
------------------------------
09-06-23 11:57 AM
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.
09-06-23 12:05 PM
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