Skip to main content
keerthanm0001
Participating Frequently
May 8, 2023 9:55 AM UTC
Solved

Expression rule for Date

I want to convert a date from 2/JAN/2020  this format to  01/02/2020 this format.

that is if the user adds the date in dd/MM(text)/yyyy , we have to convert it to MM/dd/yyyy 

How can I achieve this

    stefanhelzle0001
    Brainy
    May 8, 2023 10:45 AM UTC

    You will have to parse such special format manually. Use split() and a list of the month names to convert it.

    6 replies

    stefanhelzle0001
    Brainy
    May 8, 2023 10:45 AM UTC

    You will have to parse such special format manually. Use split() and a list of the month names to convert it.

    keerthanm0001
    Participating Frequently
    May 8, 2023 11:13 AM UTC

    Thank you so much sir,this was my first question ,and got reply very quickly

    sanchitg0002
    Inspiring
    May 8, 2023 10:46 AM UTC

    a!localVariables(
      local!date: "2/JAN/2020",
      local!split: split(local!date,"/"),
      datevalue(
        joinarray({ local!split[2], local!split[1], local!split[3] }, "/")
      )
    )

    keerthanm0001
    Participating Frequently
    May 8, 2023 11:14 AM UTC

    Thank you so much sir,this was my first question ,and got reply very quickly

    tushark6475
    Participating Frequently
    May 8, 2023 10:53 AM UTC

    You can try this approach 

    keerthanm0001
    Participating Frequently
    May 8, 2023 11:14 AM UTC

    Thank you so much sir,this was my first question ,and got reply very quickly