Developer forum

Forum » CMS - Standard features » Get 'Page Updated Date'

Get 'Page Updated Date'

Morten Lund
Morten Lund
Reply

Hi!

How can I get the 'Page Updated Date' for a given page via the API?  

It should be the same date which @GetDate('DwPageUpdatedDate') returns. 

Let's say the page with the ID=4

@Dynamicweb.Services.Pages.GetPage(4)...

But I can't find PageUpdatedDate etc. in the Page Class? 

Where should I look? 

 


Replies

 
Nicolai Pedersen
Reply

Hi Morten

Take a look at the Audit property: https://doc.dynamicweb.com/api/html/a5b05ebd-8e56-084a-14eb-112fbbb1c498.htm

BR Nicolai

 
Morten Lund
Morten Lund
Reply

Hi Nicolai

Thanks! I have completely overlooked it :D

Which of the following is most accurate to use?

DateTime LastModifiedAt = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(4).Audit.LastModifiedAt;

or

DateTime LastModifiedAt = Dynamicweb.Services.Pages.GetPage(4).Audit.LastModifiedAt;

 

Both returning the same.

 
Nicolai Pedersen
Reply

They are the same - but the latter is the 'friendly' version - I can never remember the first version :-). We mostly use the short version internally.

BR Nicolai

 

You must be logged in to post in the forum