Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get a Date String out of DateTime String
Message
De
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:
00983471
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")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform