vishnunarayan
asked on
milliseconds in Date
Hi,
I have a class "date.cs" in which a property modifieddate is of the type DateTime.
In another class i am trying to read a datevalue from a datagridview which is populated from the database.
The database table has milliseconds in all its date columns.
When i try to read the date value from the datagridview and assign it to the modifieddate of the date.cs class the milliseconds value doesnt get assigned because of which i am facing errors.
How do i solve this problem of fetching the milliseconds value.
My piece of code
string modDate = Convert.Todatetime(dtv.row s[0].cells ["datecolu mn"].value .tostring( "yyyy-MM-d d HH:mm:ss:fff"));
Datetime getDate = DateTime.ParseExact(modDat e,"yyyy-MM -dd HH:mm:ss:fff",culture);
where culture :
CultureInfo culture = System.Threading.Thread.Cu rrentThrea d.CurrentC ulture;
and i assign this getDate to the modifieddate of the date.cs file.
At this time i am loosing the milliseconds part.
I have a class "date.cs" in which a property modifieddate is of the type DateTime.
In another class i am trying to read a datevalue from a datagridview which is populated from the database.
The database table has milliseconds in all its date columns.
When i try to read the date value from the datagridview and assign it to the modifieddate of the date.cs class the milliseconds value doesnt get assigned because of which i am facing errors.
How do i solve this problem of fetching the milliseconds value.
My piece of code
string modDate = Convert.Todatetime(dtv.row
Datetime getDate = DateTime.ParseExact(modDat
where culture :
CultureInfo culture = System.Threading.Thread.Cu
and i assign this getDate to the modifieddate of the date.cs file.
At this time i am loosing the milliseconds part.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.