Link to home
Start Free TrialLog in
Avatar of mugsey
mugseyFlag 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

ASKER CERTIFIED SOLUTION
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mugsey

ASKER

However the code

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

needs DOB to be in UK format.

So I am stuck
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mugsey

ASKER

OK that is good I am on my local pc and will test
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial