If I have a Sharepoint list item with a date field.
How can I get the field value populated into a c# datetime object?
For example:
DateTime validfrom = Convert.ToDateTime(item["validfrom"]);
Although this won't produce a design time error. I am sure that this will cause problems depending on which server the code runs on and the locale settings for the server.
Is there a foolproof way to get the c# object populated?