Split Date from Datetime value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-01-23 01:07 PM
hi I need little help in splitting the date from datetime value. Previously I was doing like this
Datetime = 19/09/2022 17:44:17
date = left(Datetime, 10) = 19/09/2022
Now this is not working as
Datetime = 1/2/2023 17:44:17
date = left(Datetime, 10) = 1/2/2023 1
Any efficient way to do this manipulation?
Datetime = 19/09/2022 17:44:17
date = left(Datetime, 10) = 19/09/2022
Now this is not working as
Datetime = 1/2/2023 17:44:17
date = left(Datetime, 10) = 1/2/2023 1
Any efficient way to do this manipulation?
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-01-23 02:02 PM
Hello Rohan. What you want is to use the FormatDate function. Another thread on this forum has the answer to what you want: How to convert date format (dd/mm/yyyy) to (mm/dd/yyyy) | Blue Prism Product
The calculation UI has great help for building functions, I suggest maybe spending time looking at all the functions available under 'Date' as the answer was there for you to discover. There is also good help in the Blue Prism online help for Calculations and Decisions.
The calculation UI has great help for building functions, I suggest maybe spending time looking at all the functions available under 'Date' as the answer was there for you to discover. There is also good help in the Blue Prism online help for Calculations and Decisions.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-01-23 04:06 PM
If you are just trying to convert a DateTime value to a Date value, you can use the ToDate() function. The ToDate() function works both with DateTime data items and Text data items (as long as the string is in the proper DateTime format).
Micheal Charron
RBC
Toronto, Ontario
Canada
RBC
Toronto, Ontario
Canada
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-01-23 05:11 PM
As Michael mentioned, using the ToDate() will be your way to go. However, one of the main things to consider working with that, is that it works according to the format of date on your pc. Which means if the time on your pc is mm/dd/yyyy and the value you path to that function is dd/mm/yyyy, it will not be providing you accurate values and it might be breaking when the mm value will be more than 12 as there are only 12 months. Work with that in mind and you'll be safe to go.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-01-23 06:55 PM
Hi
You can use FormatDate, ToDate but the problem is Input Format => MM/dd/yyyy or else PFB you'll get this error

So you can try this, It's effective => Trim(Left("1/2/2023 17:44:17", InStr(Trim("1/2/2023 17:44:17"), " ")))
You can use FormatDate, ToDate but the problem is Input Format => MM/dd/yyyy or else PFB you'll get this error
So you can try this, It's effective => Trim(Left("1/2/2023 17:44:17", InStr(Trim("1/2/2023 17:44:17"), " ")))
Thanks
Prasanth
Software Engineer | RPA Developer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-23 04:22 AM
Hi @RohanGoswami1
Check this expression will it work for you
Replace(Replace("1/2/2023 17:44:17",Right("1/2/2023 17:44:17",8),"")," ","")
Thanks,
Soumya

Check this expression will it work for you
Replace(Replace("1/2/2023 17:44:17",Right("1/2/2023 17:44:17",8),"")," ","")
Thanks,
Soumya
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-23 05:48 PM
Yes. Very efficient way 🙂
Do not use any formula. Only use data item...
Expression section: [Datetime]
Store Result in section: date
Do not use any formula. Only use data item...
Expression section: [Datetime]
Store Result in section: date
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-01-23 01:32 PM
Hi Rohan,
Did you try my solution?
Did you try my solution?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-01-23 01:39 PM
For my requirements I am using the FormatDate and it working Fine. Thanks for all the responses, Appreciate it.
