You need to sign in to do that
Don't have an account?
Jeffrey OBrien 7
Converting text date into actual date
Hi everyone,
I'm trying to convert a text field with a date like "March 23, 2015" into a date field to read 3/23/2015.
Any help would be much appreciated!
I'm trying to convert a text field with a date like "March 23, 2015" into a date field to read 3/23/2015.
Any help would be much appreciated!
As mentioned in the link https://help.salesforce.com/articleView?id=notes_on_changing_custom_field_types.htm&type=5 there is a chance to loose data when you change type of a field if there is existing data and for an alternative you could try using the below implementation:
https://developer.salesforce.com/forums/?id=9060G000000UYWHQA4
I hope this helps and in case if this comes in handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej
In below article example given for date/time function please refer.
https://help.salesforce.com/articleView?id=formula_using_date_datetime.htm&type=5
Kindly mark this as solved if the reply was helpful.
Thanks.
So you need to create some code to parse the date March 23, 2015 with a regular expression and to capture the groups but that becomes quickly complicated if you can have many languages. Otherwise, it is simple with ([^ ]+?) ([0-9]+)?, ([0-9]+)
https://regex101.com/
if (group1 == 'January') { month = 1; } else if (group1 == 'February') { month = 2; } else if (group1 == 'March') { month = 3; } ...
3/23/2015 = month + '/' + group2 + '/' + group3