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
Mar 25, 2008 18:35
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
Mar 25, 2008 18:47
Vote:
 
Brilliant thanks for that
#15319
Mar 25, 2008 18:47
* 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.