when i am using this expression DateTime.ParseExact(DOB_AA.ToString(),“dd/MM/yyyy”,Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”) i am faccing problem like this
please help me
thanks
- Change Date into DateTime
- Change Globalization.CultureInfo.InvariantCulture into System.Globalization.DateTimeFormatInfo.InvariantInfo
Datetime.Parse Exact(“your input date”,“your input date format”,System.Globalization.cultureinfo.invariantculture).tostring(“MM/dd/yyyy”)
Example:
Datetime.Parse Exact(“05/27/2019”,“dd/MM/yyyy”,System.Globalization.cultureinfo.invariantculture).tostring(“MM/dd/yyyy”)
Thanks,
Aman.
Hi,
Thanks for Replying
but ur given expression giving me same issue
any other way to change pls suggest me
Can you please send me your date format how you are getting?
What is DOB_AA Data Type?
Hi
Hope this expression would help your resolve this
Datetime.Parse Exact(DOB_AA.ToString().SubString(0,10),“dd/MM/yyyy”,System.Globalization.cultureinfo.invariantculture).tostring(“MM/dd/yyyy”)
Cheers @Vivek_Kumar3
string
- Are you sure? Why you convert string to string?
- What is the value of DOB_AA?
@Vivek_Kumar3
Facing this Error Message IT IS recommended to Check If the datevalue of conversion is valid. Does mean: exists this Date in real?
E.g 31.11.2019 is Not real, due November ends with 30th
thanks it is working fine