Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • KoosMos 19 posts 41 karma points
    Jul 11, 2012 @ 11:32
    KoosMos
    0

    Get the unpublished date

    Hi,

    Is it a way to know when the document has been unpublished ?

    Thank you

  • Paul 4 posts 73 karma points
    Sep 15, 2016 @ 14:30
  • Ivan Ponomarenko 20 posts 105 karma points
    Sep 15, 2016 @ 15:48
    Ivan Ponomarenko
    1

    Hi KoosMos,

    This is example code to get date when your Content will be unpublished:

    IContent content = ApplicationContext.Current.Services.ContentService.GetById(1111);
    DateTime? expDate = content.ExpireDate;
    

    https://our.umbraco.org/documentation/Reference/management/Models/Content#expiredate

    To know when the document has been unpublished in admin panel - you can call Content context menu by clicking right mouse button, and then select "Audit Trail".

    Or in database table [umbracoLog].

    SQL query for example SELECT * FROM [dbo].[umbracoLog] WHERE [NodeId] = 1111 Where you will see all events with content.

    Hope it help you :)

    Regards, Ivan.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies