Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get a Date String out of DateTime String
Message
 
 
À
03/02/2005 10:14:06
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00983438
Message ID:
00983465
Vues:
20
Bonnie,

Thank you very much for the solution. It works.

>>The datatype is "D". The backend is VFP (have you heard of it? <g>).<
>
>LOL! No! What is VFP? <g>
>
>Anyway, I haven't used VFP as a backend with .NET, so I'm not sure, but couldn't you read the date in as a .NET datetime datatype? Or doesn't the VFP OleDb provider handle that?
>
>DateTime dtDateClosed = (DateTime)drWORK_HIS["date_clos"];
>
>
>~~Bonnie
>
>
>
>>
>>>Dmitry,
>>>
>>>But what datatype is drWORK_HIS["date_clos"]? Is it a date datatype? What is your backend data?
>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>>>Dmitry,
>>>>>
>>>>>Try using the following.
>>>>>
>>>>>DateTime test = new DateTime(4, 2, 3);
>>>>>Console.WriteLine(test.Date.ToShortDateString());
>>>>>
>>>>>Regards
>>>>>Neil
>>>>
>>>>
>>>>Neil and Bonnie,
>>>>
>>>>Unfortunately my DateTime string is of type String. Here is how I get it from a Data Reader:
>>>>
>>>>
>>>>string strDateClosed = drWORK_HIS["date_clos"].ToString();
>>>>
>>>>
>>>>Therefore, I can't see how I can apply the method ToShortDateString to it.
>>>>
>>>>Thank you both for your suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform