aspx_beginners thread: WHATZ RONG WITH THIS STRING ???
Message #1 by "Rohit Arora" <rohit_arora@i...> on Fri, 13 Dec 2002 14:38:11 +0530
|
|
hie group where i am doin rong ...
string strMyDateTime = "2/16/2002";
System.DateTime myDateTime = System.DateTime.Parse(strMyDateTime);
works fine...(i tried to test)
string strMyDate = ivuDate.Text;
DateTime newIVUDate;
newIVUDate = System.DateTime.Parse(strMyDate);
but this doesn't works atall n gives error...
also for reference
?ivuDate.Text
"26/11/2002" ---from immediate window
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a
valid DateTime.
Source Error:
Line 269: string strMyDate = ivuDate.Text;
Line 270: DateTime newIVUDate;
Line 271: newIVUDate = System.DateTime.Parse(strMyDate);
Line 272:
Line 273: if (newIVU != currIVU)
Message #2 by "Paul Riley" <rilez@t...> on Fri, 13 Dec 2002 10:01:17 -0000
|
|
Looks to me like its assuming MM/DD/YYYY and your giving it DD/MM/YYYY -
american is set as the default profile somewhere along the line - that's
your problem
-----Original Message-----
From: Rohit Arora [mailto:rohit_arora@i...]
Sent: 13 December 2002 09:08
To: aspx_beginners
Subject: [aspx_beginners] WHATZ RONG WITH THIS STRING ???
hie group where i am doin rong ...
string strMyDateTime = "2/16/2002";
System.DateTime myDateTime
System.DateTime.Parse(strMyDateTime);
works fine...(i tried to test)
string strMyDate = ivuDate.Text;
DateTime newIVUDate;
newIVUDate
System.DateTime.Parse(strMyDate);
but this doesn't works atall n gives error...
also for reference
?ivuDate.Text
"26/11/2002" ---from immediate window
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as
a valid DateTime.
Source Error:
Line 269:
string strMyDate = ivuDate.Text;
Line 270:
DateTime newIVUDate;
Line 271:
newIVUDate = System.DateTime.Parse(strMyDate);
Line 272:
Line 273:
if (newIVU != currIVU)
|