Unable to convert Date format from String

Hi,

unable to convert date time format please help, below screenshots FYR.

source date format : dd/MM/yyyy
required output format : dd MMMM yyyy

@Shriharsha_H_N

Please try this

Datetime.ParseExact(stringvariable,"dd/MM/yyyy",System.Globalization.culturalInfo.InvariantCulture).ToString("dd MMMM yyyy")

Cheers

Hello @Anil_G ,
Found error.

@Shriharsha_H_N

You have an extra bracket after doj

Cheers

@Anil_G : No anil its correct only i copied same ur syntax and bracket count also matching

@Shriharsha_H_N

That should be like this

Datetime.ParseExact(in_transactionitem.item("DOJ").ToString,"dd/MM/yyyy",System.Globalization.culturalInfo.InvariantCulture).ToString("dd MMMM yyyy")

I hope your item is a data row

Cheers

@Shriharsha_H_N

My bad it is cultureinfo

Datetime.ParseExact(in_transactionitem.item("DOJ").ToString,"dd/MM/yyyy",System.Globalization.cultureInfo.InvariantCulture).ToString("dd MMMM yyyy")

Cheers

Thanks worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.