Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get a Date String out of DateTime String
Message
From
03/02/2005 11:09:32
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00983438
Message ID:
00983497
Views:
25
Hi, Dmitry,

>You are right. What I was missing is that you can get the VFP data to the .NET DateTime type by casting (I think this is the right term). Once your data is in DateTime type there are many ways to manipulate it.

Actually, FoxPro Dates are just translated into .NET DateTime type through the DataReader or DataTable. I think that where you're getting a bit off track is thinking that
drWORK_HIS["date_clos"]
is a DateTime or Date. It's actually neither. By itself, it's just a plain old object.

Also, keep in mind you can use the following:
Convert.ToDateTime(drWORK_HIS["date_clos"])
>Thank you for your suggestion.

Hope it works for you. In case you haven't already noticed, .NET doesn't have any idea about empty dates, unfortunately. So, empty dates come across as 12/30/1899, which is quite a bother. I don't understand why it at least couldn't come in as DateTime.MinValue, but that's how it is.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform