Hi everyone I need some help with this:
It this error with this date on the database
But with this date :
It does show the error
Hi everyone I need some help with this:
It this error with this date on the database
Hello @Anelisa_Bolosha1
how you are parsing the string.
provide like.
var_datetime= DateTime.ParseExact(“2023-10-01”,“yyyy-MM-dd”,Globalization.CultureInfo.InvariantCulture)
Can you please show what expression are you using?
and to check the format open the datatable in locals panel and check what is the difference…
cheers
Can you please share the expression you are using
May be you have multiple date formats , you can try with this one
DateTime.ParseExact(InputDate,{"yyyy-MM-dd","dd.MM.yyyy","MM/dd/yyyy hh:mm:ss","dd/MM/yyyy hh:mm:ss"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("Your Format")
Regards
Sudharsan
hello @Anelisa_Bolosha1
Not like that provide like,
DateTime.ParseExact(inceptiondate,“yyyy-MM-dd”,Globalization.CultureInfo.InvariantCulture).tostring(“dd/MM/yyyy”)
if input is in - then - only if / then /
Try like this @Anelisa_Bolosha1
DateTime.ParseExact(InputDate,{"yyyy-MM-dd","dd.MM.yyyy","MM/dd/yyyy hh:mm:ss","dd/MM/yyyy hh:mm:ss","MM/dd/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("Your Format")
Regards
Sudharsan
The input date is this:
Have you tried with this expression
DateTime.ParseExact(inceptiondate,"yyyy-MM-dd",Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")
Regards
Gokul
Try this
DateTime.ParseExact(inceptiondate,{"yyyy-MM-dd","dd.MM.yyyy","MM/dd/yyyy hh:mm:ss","dd/MM/yyyy hh:mm:ss","MM/dd/yyyy","dd/MM/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd/MM/yyyy")
Regards
Sudharsan
Hi,
Simply can you try CDate as the following?
CDate(inceptiondate.Trim).ToString("dd/MM/YYYY")
Regards,
Thanks it worked fine now
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.