Groups | Blog | Home
all groups > dotnet clr > november 2004 >

dotnet clr : DateTime


Viorel Ghilas
11/29/2004 4:38:44 PM
Hi all

I have some trouble. I hava configurable date format, for ex. like this
'yyyyMMdd' and I try to convert strings to date time, and .net give me an
error 'string is not recognized as a valid DateTime', my code is:

DateTimeFormatInfo df = new DateTimeFormatInfo();
df.DateSeparator = string.Empty;
df.FullDateTimePattern = mask;
DateTime d = DateTime.Parse("20041012", df);

how to solve this problem

with best regard
Viorel Ghilas

Viorel Ghilas
11/29/2004 4:55:14 PM
Hi,

I found DateTime.ParseExact resovle it


[quoted text, click to view]

AddThis Social Bookmark Button