Try our conversational search powered by Generative AI!

Entering Historic dates

Vote:
 
Hi, I have setup my new EpiServer CMS and we are now poritng data from an old system into the new. We have notices which were posted in the past and so when we put them into EPiServer they need to be marked with historic creation date. Is this possible to do? thanks Arthur
#13050
May 22, 2007 17:36
Vote:
 
Hi Arthur! Yes, you can programmatically set any creation date you want. You have to do it through PageData.Property["PageCreated"] however, as the PageData.Created property is defined as "Get" only. For example: PageData pageData = Global.EPDataFactory.GetDefaultPageData( new PageReference(3), 3); pageData.PageName = "A new historic page"; pageData.Property["PageCreated"].Value = DateTime.Now.Subtract(new TimeSpan(7,0,0,0)); Global.EPDataFactory.Save(pageData, SaveAction.Publish|SaveAction.Save); Best regards, Johan Olofsson EPiServer AB
#15318
May 23, 2007 10:50
Vote:
 
Brilliant thanks for that
#15319
May 24, 2007 11:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.