Click here to Skip to main content
15,900,368 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: String was not recognized as a valid DateTime. Pin
vikas shukla31-Jan-10 21:33
vikas shukla31-Jan-10 21:33 
GeneralRe: String was not recognized as a valid DateTime. Pin
Dinesh Mani31-Jan-10 22:28
Dinesh Mani31-Jan-10 22:28 
GeneralRe: String was not recognized as a valid DateTime. Pin
Subin Mavunkal31-Jan-10 22:41
Subin Mavunkal31-Jan-10 22:41 
GeneralRe: String was not recognized as a valid DateTime. Pin
Dinesh Mani31-Jan-10 22:49
Dinesh Mani31-Jan-10 22:49 
GeneralRe: String was not recognized as a valid DateTime. Pin
vikas shukla31-Jan-10 23:09
vikas shukla31-Jan-10 23:09 
AnswerRe: String was not recognized as a valid DateTime. Pin
Dinesh Mani31-Jan-10 23:36
Dinesh Mani31-Jan-10 23:36 
GeneralRe: String was not recognized as a valid DateTime. Pin
m@dhu31-Jan-10 23:45
m@dhu31-Jan-10 23:45 
AnswerRe: String was not recognized as a valid DateTime. Pin
R. Giskard Reventlov1-Feb-10 0:34
R. Giskard Reventlov1-Feb-10 0:34 
AS an example try like this to correctly format your dates:

Create a web form with 2 labels named lblDateGB and lblDateUS then run the folowing code in the Page Load event:

string dateGB = DateTime.Now.ToString();
lblDateGB.Text = dateGB;

CultureInfo info = new CultureInfo("en-US");
DateTime dateUS = DateTime.Parse(dateGB, info);
lblDateUS.Text = dateUS.ToString();


Note that based on your post the server is defaulted to a US style date so the above should work. The crux is that you are converting the date using a specific culture that matches the server culture so, as long as the original date is a valid date, this should convert it correctly.


QuestionBrowse Back Button. Pin
Subin Mavunkal31-Jan-10 19:51
Subin Mavunkal31-Jan-10 19:51 
AnswerRe: Browse Back Button. Pin
Edosio Uyoyo1-Feb-10 1:58
Edosio Uyoyo1-Feb-10 1:58 
AnswerRe: Browse Back Button. Pin
April Fans2-Feb-10 20:17
April Fans2-Feb-10 20:17 
QuestionCCavenue payment gateway integration Pin
vnr31-Jan-10 19:41
vnr31-Jan-10 19:41 
GeneralRe: CCavenue payment gateway integration Pin
J a a n s31-Jan-10 22:17
professionalJ a a n s31-Jan-10 22:17 
GeneralRe: CCavenue payment gateway integration Pin
vnr31-Jan-10 23:31
vnr31-Jan-10 23:31 
Questionsys.webforms.pagerequestmanagerservererrorexception : input string was not in correct format Pin
Member 387988131-Jan-10 19:32
Member 387988131-Jan-10 19:32 
Questiondatabase genrated Menu web control Pin
Abbas_here31-Jan-10 19:27
Abbas_here31-Jan-10 19:27 
QuestionHow to integrate windows live messanger in my website Pin
SS Kevin31-Jan-10 18:53
SS Kevin31-Jan-10 18:53 
AnswerRe: How to integrate windows live messanger in my website Pin
JP_Rocks19-Oct-11 3:16
JP_Rocks19-Oct-11 3:16 
QuestionPartial Update, Pin
Hema Bairavan31-Jan-10 17:22
Hema Bairavan31-Jan-10 17:22 
Questioncss templates in ASP.NET Pin
mrkeivan31-Jan-10 8:11
mrkeivan31-Jan-10 8:11 
AnswerRe: css templates in ASP.NET Pin
Abhishek Sur31-Jan-10 9:42
professionalAbhishek Sur31-Jan-10 9:42 
QuestionCall window application from ASPX page on localhost Pin
Yosh_31-Jan-10 3:00
professionalYosh_31-Jan-10 3:00 
AnswerRe: Call window application from ASPX page on localhost Pin
Not Active31-Jan-10 5:39
mentorNot Active31-Jan-10 5:39 
AnswerRe: Call window application from ASPX page on localhost Pin
Abhishek Sur31-Jan-10 9:40
professionalAbhishek Sur31-Jan-10 9:40 
AnswerRe: Call window application from ASPX page on localhost Pin
K V Sekhar31-Jan-10 15:30
K V Sekhar31-Jan-10 15:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.