How to change the date formats

HI @anjani_priya

you can try this it will work sure even the date formats are different also

Xaml : -
ForumDates.zip (2.4 KB)

for reference you can see input and ouput :slight_smile:

input

image

output :
image

Capture5
how to declare this month format in array?
and how to change 31st may 2022 format in mmyyyy

Hi @anjani_priya

In the array declare as MMM'yy

DateTime.ParseExact("31st may 2022","d MMMM yyyy",System.Globalization.CultureInfor.InvariantCulture).ToString("MMyyyy")

Regards

How to set jan’2023 format in an array?

How to set jan’2023 fromat?

Hi @anjani_priya

you can try out this xaml even the your input dates have st or nd or rd or th it will work anyt type of date format

Xaml : - ForumDates.zip (2.7 KB)

for reference you can see the input and out put

input : -
image

OutPut : -
image

@anjani_priya

I want month and year
In input array how to set jan’2023 format?

if you need to values to array you can try this way

arr = {"jan’2023"}

Note : arr variable type is system.string[]

image

@anjani_priya

if you need to add more to arr variable then add like this

arr = {"jan’2023",dfsdfds,sdfsdf,sdfsdf,sddfsdf}

@anjani_priya

cant we add in mmyyyy format?

You can add all these date formats in array @anjani_priya

{"dd.MM.yyyy","MMM'yy","MMM'yyyy","MM/dd/yyyy","MM/dd/yy"}

Hope it helps

Try this it will work all i have created the array in that xaml it will accept the any type of format

@anjani_priya

Capture6
SEE THIS ERROR

Capture6
i GOT AN ERROR

Hi @anjani_priya

in the arr variable you can replace it will work

arr = {"dd.MM.yyyy","MMMM yyyy","MMM yyyy","dd MMMM yyyy","MMMyyyy","MMM’yyyy"}

out put : -

image

let me know it s working or not then

Make sure you have MMM'yyyy in your array @anjani_priya

Regards,

I want in jan 2023 format as output

I have done but same error

try this then

DateTime.ParseExact(System.Text.RegularExpressions.Regex.Replace( Row(0).ToString,"st|nd|rd|th|’",""),arr,System.Globalization.CultureInfo.CurrentUICulture.InvariantCulture).ToString("MMM yyyy")

out put : -

image

@anjani_priya

Input is
Jan’ 2023
output is Jan 2023