Click here to Skip to main content
13,147,383 members (31,478 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have screen in c# webapplication, where i add news on particular dates.And can edit those dates also.It workes in my local sytem.But shows datetime error when it was running in iis 7 server(Used sql database).And i knew that the short date and long date format in server was different from local system.So i changed date format in local system same as in iis.But still it is working properly.Code i used is shown below:

string stringDate="19/11/2012";
DateTime date = Convert.ToDateTime(ff_SetDate(stringDate));

public string ff_SetDate(string datetime)

string[] date = datetime.Split('/');
string DD = date[0];
string MM = date[1];
string YY = date[2];
string dt = DD + "/" + MM + "/" + YY;
return (dt);
catch (Exception ex)

throw ex;
Posted 18-Nov-12 18:26pm
Updated 18-Nov-12 19:33pm
We don't have access to your computer, no we have access to the host of the IIS server. Got the hint?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

change the datetime in hosted server,then its ok.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

One of the main application is running in server which depends on that format.Unfortunately i dont have an option to do that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100