Automation Question-Date

Hi,

I have a Number-961006 which is actually DOB.(96-year,10-month,06-day).I want to fill the year,means i want the value as 19961006 or if the number is 011006 the number should be 20011006. I tried converting it to CDate(number).tostring(“yyyymmdd”)but its throwing an error

Is there any another method to do it.

DateTime.ParseExact(“961006”,“yyMMdd”,System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyyMMdd”)

Note that you used mm which is minutes. MM is month.

image

image

Here is a full reference of the format identifiers:

1 Like

I tried this equation.But since i am passing the number(961006) as string it is throwing an error

Hi @amruta_George

Could you share the xaml?

It’s supposed to be string. String is what the function requires, not number.

Show us your entire expression and what the first Message Box shows. Make sure you don’t have any extra spaces at the beginning or end of the string. You can just use ID_num.Trim in the ParseExact.

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