Avatar of mugsey
mugsey
Flag for United Kingdom of Great Britain and Northern Ireland asked on

parse datetime extract does not work on test server

asp.net and sql server app

I am capturing DOB in UK format (see code)

I have registration page that needs DOB - code below works fine on local pc but on test server I need to enter USA dateformat to get it working.

What am I doing wrong?

I need to ensure that dob is UK format.

OR should I convert DOB format just to user when displayed?


customer.DOB = DateTime.ParseExact(dateOfBirth.Text, "dd-MM-yyyy", CultureInfo.InvariantCulture);

Open in new window

ASP.NETC#Visual Basic.NET

Avatar of undefined
Last Comment
Nasir Razzaq

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Roshan Davis

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Roshan Davis

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
mugsey

ASKER
However the code

DateTime.ParseExact(dateOfBirth.Text, "dd-MM-yyyy",

needs DOB to be in UK format.

So I am stuck
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
mugsey

ASKER
OK I will try but will no be able to answer you until Friday as I cannot now get access to dev server until then.

Thanks
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
mugsey

ASKER
OK that is good I am on my local pc and will test
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.