I had some trouble parsing the date strings created by Umbraco’s Date Picker to a System.DateTime object.
Following is a short snippet, which does the trick:
DateTime date = DateTime.ParseExact( content.GetPropertyValue<string>("datePropertyAlias"), @"M\/d\/yyyy", null);
Note that content is an IPublishedContent object.
0 Comments