I think you'll have to use the ContentService to do this (which means hitting the database). Something like:
var contentService = UmbracoContext.Current.Application.Services.ContentService;
var content = contentService.GetById(1153); // your Id
DateTime? unpublishDate = content.ExpireDate;
Displaying unpublish at date
Hi,
It is possible to display the unpubish at date on a page? I've tried to get this to display a couple of ways but not had any luck as of yet.
Regards, Jeff
I think you'll have to use the ContentService to do this (which means hitting the database). Something like:
As I say, this hits the DB, so use with caution.
Thanks I'll give this a go, hitting the database might be ok as it will only be on one page which shouldn't be getting hit all of the time.
Regards, Jeff
is working on a reply...