How to get value from Orchard.Fields DateTime

Topics: General
Aug 24, 2012 at 7:20 PM

When adding fields to the Profile Part, I'm able to retrieve the value for Text fields using

contentItem.ProfilePart.FirstName.Value

where contentItem is the User Content Item and FirstName is the text field I added to the Profile Part.

If I add a field that is a DateTime field named LastUpdate, how do I get the vale?

contentItem.ProfilePart.LastUpdate.Value doesn't work, neither does contentItem.ProfilePart.LastUpdate.Date.Value

Thanks for the help

Aug 24, 2012 at 8:15 PM

I think I got it...

contentItem.ProfilePart.LastUpdate.DateTime

and if I want just the date...

contentItem.ProfilePart.LastUpdate.DateTime.Date