Convert text into date format

Certified Associate Developer

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

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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.

Reply
  • 0
    Certified Lead Developer

    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.

Children
No Data