K
Keith G Hicks
the "ArticleDate" variable is populated with data from an XML file. The XML
file has the date string like this: 10/24/09
I'm checking to see if it's a valid date with "IsDate" and then I need to
convert it to a yyyy-mm-dd format. But it's not working now for some reason.
Here's my code:
If IsDate(ArticleDate) Then
ArticleDate = CDate(ArticleDate).ToString("yyyy-mm-dd")
Else
ArticleErrors = ArticleErrors & ", date is not a valid date value"
End If
Using the date noted above, the code runsn but the 2nd line is converting
the date to "2009-00-24" instead of "2009-10-24"
CDate(ArticleDate) seems to be okay. When I mouse over that during
execution, the debugger shows it as #10/24/2009# like I'd expect.
What am I doing wrong?
Thanks,
Keith
file has the date string like this: 10/24/09
I'm checking to see if it's a valid date with "IsDate" and then I need to
convert it to a yyyy-mm-dd format. But it's not working now for some reason.
Here's my code:
If IsDate(ArticleDate) Then
ArticleDate = CDate(ArticleDate).ToString("yyyy-mm-dd")
Else
ArticleErrors = ArticleErrors & ", date is not a valid date value"
End If
Using the date noted above, the code runsn but the 2nd line is converting
the date to "2009-00-24" instead of "2009-10-24"
CDate(ArticleDate) seems to be okay. When I mouse over that during
execution, the debugger shows it as #10/24/2009# like I'd expect.
What am I doing wrong?
Thanks,
Keith