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:38:01
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00983438
Message ID:
00983478
Vues:
16
>Dmitry-
>
>PMFJI.
>
>>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.
>
>Well, why not return it from the Property? Something like
>
>string strDateClosed = ((DateTime)(drWORK_HIS["date_clos"])).ToString();
>
>
>Another note, although ToShortDateString() would probably work best, recall that you can pass format strings to ToString(). Like
>
DateTime.Now.ToString("MM/dd/yyyy")
Nancy,

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.

Thank you for your suggestion.
"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