Date time format is working fine when it is running in local server but the same is not working fine when it is uploaded to server.
in localhost
02-02-2014
in server
2-2-2014
I want localhost format in server also
Date time format is working fine when it is running in local server but the same is not working fine when it is uploaded to server.
in localhost
02-02-2014
in server
2-2-2014
I want localhost format in server also
You should provide some sample code to help define the context. But keeping things as simple as possible...
A date is a date, regardless of the host computer and its locale, so if you want to disregard the host computer locale, which affects things like how dates are expressed, you might want to consider using a Custom Date Format.
// Display the date using a custom date format
DateTime thisDate = new DateTime(2008, 3, 15);
Console.WriteLine(thisDate.ToString("dd-MM-yyyy")); // Displays 15-03-2008
Console.WriteLine(thisDate.ToString("dd MMM yyyy")); // Displays 15 Mar 2008
Perhaps your date formatting is not the same
DateTime time = new DateTime(2014, 02, 02);
string format = "mm-dd-yy";
Console.WriteLine(time.ToString(format)); //00-02-14
format = "M-d-yy";
Console.WriteLine(time.ToString(format)); //2-2-14