Skip to main content
purushottamk0001
New Participant
January 19, 2023
Question

Convert text into date format

  • January 19, 2023
  • 2 replies
  • 1 view

as per the requirement,

I have to convert user texts into DB date format 

Required format: YYYY/MM/DD

expected date inputs:

Date with Month Name   March 20, 2023
DD/MM/YYYY 02/12/2022
MM/DD/YYYY 12/20/2022
D/M/YYYY 3/9/2022

2 replies

davel001150
January 19, 2023

Is 02/12/2022 February 12, or December 2?  You literally do not have any way to tell either Appian or the database which it is unless you give up one of the expected input formats or require the user to configure/input which format they're using.

Other than that, try todate() and see what comes out.  It may work for most cases, and some you may just need some minor adjustment.  You could build a simple a!match() that replaces month text with a number, and then pass those to todate(), if you even need to.

January 23, 2023

Convert text dates by using the DATEVALUE function
Enter =DATEVALUE(
Click the cell that contains the text-formatted date that you want to convert.
Enter )
Press ENTER and the DATEVALUE function returns the serial number of the date that is represented by the text date.

Regards,

Will