Umbraco does quite a lot of caching of values, so changing them in the database isn't necceserlly going to stick, because if someone later comes along and loads the page though the back office it might get those values from the cache - and then save them.
Its better to change these values via the API - because that will update the cache too, and it will all have a better chance of sticking.
For what you want to do you could use the content service :
as a quick example this would set the date via a Api Controller
public class SetContentDateApiController: UmbracoAuthorizedApiController
{
[HttpGet]
public bool SetContentDate(int id)
{
var item = Services.ContentService.GetById(id);
if (item == null) throw new KeyNotFoundException(nameof(id));
item.CreateDate = new DateTime(2019, 03, 01, 13, 38, 32, 890);
Services.ContentService.Save(item);
return true;
}
}
Change the created date for specific post won't work
I tried to change the created date for the specific post in Umbraco 8. after some time it changes back to original published date
Hi,
Umbraco does quite a lot of caching of values, so changing them in the database isn't necceserlly going to stick, because if someone later comes along and loads the page though the back office it might get those values from the cache - and then save them.
Its better to change these values via the API - because that will update the cache too, and it will all have a better chance of sticking.
For what you want to do you could use the content service :
as a quick example this would set the date via a Api Controller
Then you would be able to call this by visiting: http://yoursite/umbraco/backoffice/api/SetContentDateApi/SetContentDate/7514
is working on a reply...